ui: basic map scroller
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user