diff --git a/examples/2048/2048.v b/examples/2048/2048.v index 52e6694a70..fd81aa2a89 100644 --- a/examples/2048/2048.v +++ b/examples/2048/2048.v @@ -649,7 +649,7 @@ fn (app &App) draw_tiles() { toffset := app.ui.tile_size + app.ui.padding_size tiles_size := min(app.ui.window_width, app.ui.window_height) - app.ui.border_size * 2 // Draw the padding around the tiles - app.gg.draw_rect(xstart, ystart, tiles_size, tiles_size, app.theme.padding_color) + app.gg.draw_rounded_rect(xstart, ystart, tiles_size / 2, tiles_size / 2, tiles_size / 24, app.theme.padding_color) // Draw the actual tiles for y in 0 .. 4 { for x in 0 .. 4 { @@ -665,7 +665,7 @@ fn (app &App) draw_tiles() { th := tw // square tiles, w == h xoffset := xstart + app.ui.padding_size + x * toffset + (app.ui.tile_size - tw) / 2 yoffset := ystart + app.ui.padding_size + y * toffset + (app.ui.tile_size - th) / 2 - app.gg.draw_rect(xoffset, yoffset, tw, th, tile_color) + app.gg.draw_rounded_rect(xoffset, yoffset, tw / 2, th / 2, tw / 8, tile_color) if tidx != 0 { // 0 == blank spot xpos := xoffset + tw / 2 ypos := yoffset + th / 2 @@ -962,6 +962,7 @@ fn main() { bg_color: app.theme.bg_color width: default_window_width height: default_window_height + sample_count: 8 // higher quality curves create_window: true window_title: window_title frame_fn: frame diff --git a/vlib/gg/gg.v b/vlib/gg/gg.v index e81a0109b0..98f40f488d 100644 --- a/vlib/gg/gg.v +++ b/vlib/gg/gg.v @@ -54,6 +54,7 @@ pub: // wait_events bool // set this to true for UIs, to save power fullscreen bool scale f32 = 1.0 + sample_count int // vid needs this // init_text bool font_path string @@ -253,6 +254,7 @@ pub fn new_context(cfg Config) &Context { html5_canvas_name: cfg.window_title.str width: cfg.width height: cfg.height + sample_count: cfg.sample_count high_dpi: true fullscreen: cfg.fullscreen }