using new features in the ui library
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 21 Sep 2021 22:59:28 +0000 (17:59 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 21 Sep 2021 22:59:28 +0000 (17:59 -0500)
modules/ui/font.onyx
modules/ui/ui.onyx

index f2f809ff09ad643a3d80e7314891fdadd39b6578..6d8a82a7e8b595f44eb18c32a44d97c3108d20aa 100644 (file)
@@ -32,7 +32,7 @@ Font :: struct {
         return ~~font.common.baseline * size;
     }
 
-    render :: (use f: ^Font, text: str, x: f32, y: f32, font_size: f32, color := gfx.Color4.{1,1,1}) {
+    render :: (use f: ^Font, text: str, x, y: f32, font_size: f32, color := gfx.Color4.{1,1,1}) {
         gfx.set_texture(^texture);
 
         switch rendering_kind {
index e924453d4317319f5df296eccf429e6c0e683719..5cfe8f7f2ddf72e5dafae7b6f41c210ba0f0017f 100644 (file)
@@ -123,7 +123,7 @@ draw_rect :: #match {
         gfx.rect(.{ x0, y0 }, .{ width, height }, color);
     },
 
-    (x: f32, y: f32, w: f32, h: f32, color := gfx.Color4.{1,1,1}) {
+    (x, y, w, h: f32, color := gfx.Color4.{1,1,1}) {
         gfx.set_texture();
         gfx.rect(.{ x, y }, .{ w, h }, color);
     }
@@ -158,7 +158,7 @@ Rectangle :: struct {
     bottom_left  :: (use r: Rectangle) -> (x: f32, y: f32) do return math.min(x0, x1), math.max(y0, y1);
     bottom_right :: (use r: Rectangle) -> (x: f32, y: f32) do return math.max(x0, x1), math.max(y0, y1);
 
-    contains :: (use r: Rectangle, x: f32, y: f32) -> bool {
+    contains :: (use r: Rectangle, x, y: f32) -> bool {
         return math.min(x0, x1) <= x && x <= math.max(x0, x1) &&
                math.min(y0, y1) <= y && y <= math.max(y0, y1);
     }