diff --git a/ui/debug.go b/ui/debug.go index eda7170..bdd7da9 100644 --- a/ui/debug.go +++ b/ui/debug.go @@ -95,14 +95,14 @@ func (o *debugOverlay) renderControl(ctx Context, control Control) { nameTextureHeight := float32(nameTexture.Height()) renderer.FillRectangle(pos.RectRel2D(nameTextureWidth, nameTextureHeight), color.Black) renderer.DrawTexturePoint(nameTexture, pos) - childPos := pos.Add2D(nameTextureWidth+8, 0) + childPos := pos.Add2D(nameTextureWidth+ctx.Style().Dimensions.Margin, 0) for _, child := range node.Children { if childPos.Y == maxY { childPos.Y = maxY + nameTextureHeight } renderHoverNode(childPos, child) maxY = childPos.Y - childPos.Y += nameTextureHeight + 8 + childPos.Y += nameTextureHeight + ctx.Style().Dimensions.Margin } } renderHoverNode(geom.PtF32(4, 4), o.hoverNodes) diff --git a/ui/style.go b/ui/style.go index 266db45..25f8004 100644 --- a/ui/style.go +++ b/ui/style.go @@ -12,6 +12,7 @@ var defaultPalette *Palette var defaultStyle *Style type Dimensions struct { + Margin float32 OutlineWidth float32 ScrollbarWidth float32 TextPadding float32 @@ -67,6 +68,7 @@ type Style struct { func DefaultDimensions() *Dimensions { return &Dimensions{ + Margin: 8., OutlineWidth: 2., ScrollbarWidth: 16., TextPadding: 8.,