atomize-element-interface #2

Merged
sashakoshka merged 20 commits from atomize-element-interface into main 2023-01-16 17:24:23 +00:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit 7442ec4b60 - Show all commits

View File

@ -5,7 +5,7 @@ import "image/draw"
import "image/color"
// Canvas is like Image but also requires Set and SetRGBA methods. This
// interface can be easily satisfied using an image.RGBA struct.
// interface can be easily satisfied using a BasicCanvas struct.
type Canvas interface {
draw.Image
Buffer () (data []color.RGBA, stride int)

View File

@ -20,6 +20,8 @@ type Layout interface {
Arrange (entries []LayoutEntry, width, height int)
// MinimumSize returns the minimum width and height that the layout
// needs to properly arrange the given slice of layout entries.
// needs to properly arrange the given slice of layout entries, given a
// "suqeeze" width so that the height can be determined for elements
// fulfilling the Expanding interface.
MinimumSize (entries []LayoutEntry) (width, height int)
}