From 1378093c12c76bdc08a37f592fc8036a2ab91dcd Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Mon, 16 Jan 2023 00:02:15 -0500 Subject: [PATCH] Improved some documentation wording regarding Core and CoreControl --- elements/core/core.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/elements/core/core.go b/elements/core/core.go index 0610337..c836929 100644 --- a/elements/core/core.go +++ b/elements/core/core.go @@ -64,9 +64,10 @@ func (core *Core) SetParentHooks (hooks tomo.ParentHooks) { core.hooks = hooks } -// CoreControl is a struct that can exert control over a control struct. It can -// be used as a canvas. It must not be directly embedded into an element, but -// instead kept as a private member. +// CoreControl is a struct that can exert control over a Core struct. It can be +// used as a canvas. It must not be directly embedded into an element, but +// instead kept as a private member. When a Core struct is created, a +// corresponding CoreControl struct is linked to it and returned alongside it. type CoreControl struct { tomo.BasicCanvas core *Core @@ -90,7 +91,8 @@ func (control CoreControl) PushAll () { control.PushRegion(control.Bounds()) } -// AllocateCanvas resizes the canvas. +// AllocateCanvas resizes the canvas, constraining the width and height so that +// they are not less than the specified minimum width and height. func (control *CoreControl) AllocateCanvas (width, height int) { width, height, _ = control.ConstrainSize(width, height) control.core.canvas = tomo.NewBasicCanvas(width, height)