Replaced tomo.Image with tomo.Canvas and tomo.Pattern
This is the first step in transitioning the API over to the new design. The new tomo.Canvas interface gives drawing functions direct access to data buffers and eliminates overhead associated with calling functions for every pixel. The entire artist package will be remade around this.
This commit is contained in:
@@ -13,7 +13,7 @@ type Mouse struct {
|
||||
*core.Core
|
||||
core core.CoreControl
|
||||
drawing bool
|
||||
color tomo.Image
|
||||
color artist.Pattern
|
||||
lastMousePos image.Point
|
||||
}
|
||||
|
||||
@@ -33,11 +33,11 @@ func (element *Mouse) Handle (event tomo.Event) {
|
||||
element.core.AllocateCanvas (
|
||||
resizeEvent.Width,
|
||||
resizeEvent.Height)
|
||||
artist.Rectangle (
|
||||
artist.FillRectangle (
|
||||
element.core,
|
||||
theme.AccentImage(),
|
||||
artist.NewUniform(color.Black),
|
||||
1, element.Bounds())
|
||||
element.Bounds())
|
||||
// TODO: draw a stroked rectangle around the edges
|
||||
artist.Line (
|
||||
element.core, artist.NewUniform(color.White), 1,
|
||||
image.Pt(1, 1),
|
||||
|
||||
Reference in New Issue
Block a user