Compare commits

...

3 Commits
v0.8.0 ... main

Author SHA1 Message Date
e38cbe7205 Box doesn't crash when cetering a nil texture 2024-05-27 15:20:11 -04:00
09cec81f30 Upgrade Tomo API 2024-05-27 15:17:33 -04:00
0799f3645b Make boxes visible by default 2024-05-26 17:28:17 -04:00
3 changed files with 4 additions and 15 deletions

13
box.go
View File

@ -19,7 +19,6 @@ type box struct {
parent parent
outer anyBox
visible bool
bounds image.Rectangle
minSize image.Point
userMinSize image.Point
@ -175,16 +174,6 @@ func (this *box) SetPadding (padding tomo.Inset) {
this.invalidateMinimum()
}
func (this *box) SetVisible (visible bool) {
if this.visible == visible { return }
this.visible = visible
this.invalidateMinimum()
}
func (this *box) Visible () bool {
return this.visible
}
func (this *box) SetDNDData (dat data.Data) {
this.dndData = dat
}
@ -337,7 +326,7 @@ func (this *box) Draw (can canvas.Canvas) {
pen.Rectangle(bounds)
// centered texture
if this.textureMode == textureModeCenter {
if this.textureMode == textureModeCenter && this.texture != nil {
textureBounds := this.texture.Bounds()
textureOrigin :=
bounds.Min.

2
go.mod
View File

@ -3,7 +3,7 @@ module git.tebibyte.media/tomo/x
go 1.20
require (
git.tebibyte.media/tomo/tomo v0.33.0
git.tebibyte.media/tomo/tomo v0.34.0
git.tebibyte.media/tomo/typeset v0.7.1
git.tebibyte.media/tomo/xgbkb v1.0.1
github.com/jezek/xgb v1.1.0

4
go.sum
View File

@ -1,6 +1,6 @@
git.tebibyte.media/sashakoshka/xgbkb v1.0.0/go.mod h1:pNcE6TRO93vHd6q42SdwLSTTj25L0Yzggz7yLe0JV6Q=
git.tebibyte.media/tomo/tomo v0.33.0 h1:BBm1oRsogBLeqVKeevNqG9RPCOdmbGeiQM/9hd2GHE8=
git.tebibyte.media/tomo/tomo v0.33.0/go.mod h1:C9EzepS9wjkTJjnZaPBh22YvVPyA4hbBAJVU20Rdmps=
git.tebibyte.media/tomo/tomo v0.34.0 h1:r5yJPks9rtzdDI2RyAUdqa1qb6BebG0QFe2cTmcFi+0=
git.tebibyte.media/tomo/tomo v0.34.0/go.mod h1:C9EzepS9wjkTJjnZaPBh22YvVPyA4hbBAJVU20Rdmps=
git.tebibyte.media/tomo/typeset v0.7.1 h1:aZrsHwCG5ZB4f5CruRFsxLv5ezJUCFUFsQJJso2sXQ8=
git.tebibyte.media/tomo/typeset v0.7.1/go.mod h1:PwDpSdBF3l/EzoIsa2ME7QffVVajnTHZN6l3MHEGe1g=
git.tebibyte.media/tomo/xgbkb v1.0.1 h1:b3HDUopjdQp1MZrb5Vpil4bOtk3NnNXtfQW27Blw2kE=