Better on browsers
This commit is contained in:
parent
977c24968b
commit
c1b0ea24a6
@ -94,8 +94,8 @@ impl Game {
|
||||
}
|
||||
|
||||
pub fn update_window_size(&mut self) {
|
||||
let new_height = math::clamp(screen_height(), 400.0, 800.0);
|
||||
let new_width = math::clamp(screen_width(), 500.0, 1000.0);
|
||||
let new_height = math::clamp(screen_height(), 100.0, 800.0);
|
||||
let new_width = math::clamp(screen_width(), 100.0, 1000.0);
|
||||
if new_height == self.window_height && new_width == self.window_width {
|
||||
return;
|
||||
}
|
||||
|
@ -98,12 +98,12 @@ impl Button {
|
||||
}
|
||||
|
||||
fn draw_label(&self) {
|
||||
let font_color = match self.is_active {
|
||||
let font_color = match self.is_active {
|
||||
true => Color::from_rgba(0, 0, 0, 255),
|
||||
false => Color::from_rgba(100, 100, 100, 255)
|
||||
false => Color::from_rgba(100, 100, 100, 255),
|
||||
};
|
||||
|
||||
let font_size = (0.5 * self.rect.h) as u16;
|
||||
let font_size = (0.3 * self.rect.w) as u16;
|
||||
let dims = measure_text(&self.text, None, font_size, 1.0);
|
||||
let button_draw_offset = self.get_button_draw_offset();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user