mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 10:25:37 +00:00
layout: take a size, not constraints in Context.Reset
Taking a constraint in Reset smells too much of a layout operation, whereas a size is simpler and only serves to set the context constraints to something sensible. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+4
-3
@@ -102,9 +102,10 @@ func (s *Context) Layout(cs Constraints, w Widget) Dimensions {
|
||||
return s.Dimensions
|
||||
}
|
||||
|
||||
// Reset the context.
|
||||
func (c *Context) Reset(cfg Config, cs Constraints) {
|
||||
c.Constraints = cs
|
||||
// Reset the context. The constraints' minimum and maximum values are
|
||||
// set to the size.
|
||||
func (c *Context) Reset(cfg Config, size image.Point) {
|
||||
c.Constraints = RigidConstraints(size)
|
||||
c.Dimensions = Dimensions{}
|
||||
c.Config = cfg
|
||||
if c.Ops == nil {
|
||||
|
||||
Reference in New Issue
Block a user