diff --git a/README.md b/README.md index dbe84d2..1371ef8 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ DebugUI is a UI toolkit for Ebitengine applications, primarily intended for debugging purposes. -**The project is currently under development. The API is subject to frequent changes. Please do not use it in production.** +**The project is currently under development. The API is subject to frequent changes.** DebugUI is based on [Microui](https://github.com/rxi/microui). The original Microui was developed by [@rxi](https://github.com/rxi/microui). The original Go port was developed by [@zeozeozeo](https://github.com/zeozeozeo) and [@Zyko0](https://github.com/Zyko0). diff --git a/context.go b/context.go index dd06ade..ad7c4a3 100644 --- a/context.go +++ b/context.go @@ -96,7 +96,11 @@ func (c *Context) update(f func(ctx *Context) error) (inputCapturingState InputC // Check whether the cursor is on any of the root containers. pt := c.pointingPosition() for _, cnt := range c.rootContainers { - if pt.In(cnt.layout.Bounds) { + bounds := cnt.layout.Bounds + if cnt.collapsed { + bounds.Max.Y = cnt.layout.BodyBounds.Min.Y + } + if pt.In(bounds) { inputCapturingState |= InputCapturingStateHover } } diff --git a/widget.go b/widget.go index 1d03c6a..1551e54 100644 --- a/widget.go +++ b/widget.go @@ -44,6 +44,10 @@ func (c *Context) pointingOver(bounds image.Rectangle) bool { } func (c *Context) pointingDelta() image.Point { + // The delta is always (0, 0) when a touch just started. + if c.pointing.isTouchActive() && c.pointing.justPressed() { + return image.Point{} + } return c.pointingPosition().Sub(c.lastPointingPos) }