Always use floating point values for pixels
This commit is contained in:
parent
7d42788be2
commit
8088630803
|
@ -30,7 +30,7 @@ mod button;
|
||||||
const EDITOR_WIDTH: u32 = 600;
|
const EDITOR_WIDTH: u32 = 600;
|
||||||
const EDITOR_HEIGHT: u32 = 490;
|
const EDITOR_HEIGHT: u32 = 490;
|
||||||
|
|
||||||
const SPECTRUM_ANALYZER_HEIGHT: u32 = 260;
|
const SPECTRUM_ANALYZER_HEIGHT: f32 = 260.0;
|
||||||
|
|
||||||
const DARK_GRAY: Color = Color::rgb(0xc4, 0xc4, 0xc4);
|
const DARK_GRAY: Color = Color::rgb(0xc4, 0xc4, 0xc4);
|
||||||
const DARKER_GRAY: Color = Color::rgb(0x69, 0x69, 0x69);
|
const DARKER_GRAY: Color = Color::rgb(0x69, 0x69, 0x69);
|
||||||
|
@ -120,7 +120,7 @@ fn top_bar(cx: &mut Context) {
|
||||||
/// This shows a spectrum analyzer for the plugin's output, and also acts as an X-Y pad for the
|
/// This shows a spectrum analyzer for the plugin's output, and also acts as an X-Y pad for the
|
||||||
/// frequency and resonance parameters.
|
/// frequency and resonance parameters.
|
||||||
fn spectrum_analyzer(cx: &mut Context) {
|
fn spectrum_analyzer(cx: &mut Context) {
|
||||||
const LABEL_HEIGHT: u32 = 20;
|
const LABEL_HEIGHT: f32 = 20.0;
|
||||||
|
|
||||||
HStack::new(cx, |cx| {
|
HStack::new(cx, |cx| {
|
||||||
Label::new(cx, "Resonance")
|
Label::new(cx, "Resonance")
|
||||||
|
@ -129,8 +129,8 @@ fn spectrum_analyzer(cx: &mut Context) {
|
||||||
// least visually does the right thing
|
// least visually does the right thing
|
||||||
.text_wrap(false)
|
.text_wrap(false)
|
||||||
.rotate(270.0f32)
|
.rotate(270.0f32)
|
||||||
.width(Pixels(LABEL_HEIGHT as f32))
|
.width(Pixels(LABEL_HEIGHT))
|
||||||
.height(Pixels(SPECTRUM_ANALYZER_HEIGHT as f32))
|
.height(Pixels(SPECTRUM_ANALYZER_HEIGHT))
|
||||||
// HACK: The `.space()` on the HStack doesn't seem to work correctly here
|
// HACK: The `.space()` on the HStack doesn't seem to work correctly here
|
||||||
.left(Pixels(10.0))
|
.left(Pixels(10.0))
|
||||||
.right(Pixels(-5.0))
|
.right(Pixels(-5.0))
|
||||||
|
@ -150,7 +150,7 @@ fn spectrum_analyzer(cx: &mut Context) {
|
||||||
.child_space(Stretch(1.0))
|
.child_space(Stretch(1.0))
|
||||||
.width(Percentage(100.0))
|
.width(Percentage(100.0))
|
||||||
.background_color(DARK_GRAY)
|
.background_color(DARK_GRAY)
|
||||||
.height(Pixels(SPECTRUM_ANALYZER_HEIGHT as f32));
|
.height(Pixels(SPECTRUM_ANALYZER_HEIGHT));
|
||||||
|
|
||||||
Label::new(cx, "Frequency")
|
Label::new(cx, "Frequency")
|
||||||
.font_size(18.0)
|
.font_size(18.0)
|
||||||
|
|
Loading…
Reference in a new issue