From a79f2eaf64a2bb34abe35ab9e93485964b76de70 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 10 Jan 2023 20:31:18 -0500 Subject: [PATCH] Test element has a cool border --- elements/basic/test.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/elements/basic/test.go b/elements/basic/test.go index 133510a..4c8307d 100644 --- a/elements/basic/test.go +++ b/elements/basic/test.go @@ -31,21 +31,21 @@ func (element *Test) Handle (event tomo.Event) { element.core.AllocateCanvas ( resizeEvent.Width, resizeEvent.Height) - for y := 0; y < resizeEvent.Height; y ++ { - for x := 0; x < resizeEvent.Width; x ++ { - pixel := color.RGBA { + artist.Rectangle ( + element.core, + artist.NewUniform (color.RGBA { R: 0x40, G: 0x80, B: 0x90, A: 0xFF, - } - element.core.SetRGBA (x, y, pixel) - }} + }), + artist.NewUniform(color.Black), + 1, element.Bounds()) artist.Line ( element.core, artist.NewUniform(color.White), 1, - image.Pt(0, 0), - image.Pt(resizeEvent.Width, resizeEvent.Height)) + image.Pt(1, 1), + image.Pt(resizeEvent.Width - 2, resizeEvent.Height - 2)) artist.Line ( element.core, artist.NewUniform(color.White), 1, - image.Pt(0, resizeEvent.Height), - image.Pt(resizeEvent.Width, 0)) + image.Pt(1, resizeEvent.Height - 2), + image.Pt(resizeEvent.Width - 2, 1)) case tomo.EventMouseDown: element.drawing = true