ui: basic map scroller

This commit is contained in:
Ilia Denisov
2026-03-06 23:29:06 +02:00
committed by GitHub
parent 29d188969b
commit 1de621c743
68 changed files with 9861 additions and 118 deletions
+54
View File
@@ -0,0 +1,54 @@
package world
import "image/color"
// RenderStyle describes visual parameters for renderer passes.
// It is intentionally screen-space oriented (pixels), since the renderer
// already projects world coordinates into canvas pixels.
type RenderStyle struct {
// PointRadiusPx is the screen-space radius for Point markers.
PointRadiusPx float64
// PointFill is the fill color for points.
PointFill color.Color
// CircleFill is the fill color for circles.
CircleFill color.Color
// LineStroke is the stroke color for lines.
LineStroke color.Color
// LineWidthPx is the stroke width for lines.
LineWidthPx float64
// LineDash is the dash pattern for lines. Empty => solid.
LineDash []float64
// LineDashOffset is the dash phase for lines.
LineDashOffset float64
}
// DefaultRenderStyle returns the default style used when UI does not provide one.
// Defaults are intentionally simple and stable for testing.
func DefaultRenderStyle() RenderStyle {
return RenderStyle{
PointRadiusPx: 2.0,
PointFill: color.White,
CircleFill: color.White,
LineStroke: color.White,
LineWidthPx: 2.0,
LineDash: nil,
LineDashOffset: 0,
}
}
func DefaultIncrementalPolicy() IncrementalPolicy {
return IncrementalPolicy{
CoalesceUpdates: false,
AllowShiftOnly: false,
RenderBudgetMs: 0,
MaxCatchUpAreaPx: 0,
}
}