Test element has a cool border
This commit is contained in:
parent
b3e6beb8ad
commit
a79f2eaf64
@ -31,21 +31,21 @@ func (element *Test) Handle (event tomo.Event) {
|
|||||||
element.core.AllocateCanvas (
|
element.core.AllocateCanvas (
|
||||||
resizeEvent.Width,
|
resizeEvent.Width,
|
||||||
resizeEvent.Height)
|
resizeEvent.Height)
|
||||||
for y := 0; y < resizeEvent.Height; y ++ {
|
artist.Rectangle (
|
||||||
for x := 0; x < resizeEvent.Width; x ++ {
|
element.core,
|
||||||
pixel := color.RGBA {
|
artist.NewUniform (color.RGBA {
|
||||||
R: 0x40, G: 0x80, B: 0x90, A: 0xFF,
|
R: 0x40, G: 0x80, B: 0x90, A: 0xFF,
|
||||||
}
|
}),
|
||||||
element.core.SetRGBA (x, y, pixel)
|
artist.NewUniform(color.Black),
|
||||||
}}
|
1, element.Bounds())
|
||||||
artist.Line (
|
artist.Line (
|
||||||
element.core, artist.NewUniform(color.White), 1,
|
element.core, artist.NewUniform(color.White), 1,
|
||||||
image.Pt(0, 0),
|
image.Pt(1, 1),
|
||||||
image.Pt(resizeEvent.Width, resizeEvent.Height))
|
image.Pt(resizeEvent.Width - 2, resizeEvent.Height - 2))
|
||||||
artist.Line (
|
artist.Line (
|
||||||
element.core, artist.NewUniform(color.White), 1,
|
element.core, artist.NewUniform(color.White), 1,
|
||||||
image.Pt(0, resizeEvent.Height),
|
image.Pt(1, resizeEvent.Height - 2),
|
||||||
image.Pt(resizeEvent.Width, 0))
|
image.Pt(resizeEvent.Width - 2, 1))
|
||||||
|
|
||||||
case tomo.EventMouseDown:
|
case tomo.EventMouseDown:
|
||||||
element.drawing = true
|
element.drawing = true
|
||||||
|
Reference in New Issue
Block a user