55 lines
1.3 KiB
Go
55 lines
1.3 KiB
Go
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,
|
|
}
|
|
}
|