themes and styles

This commit is contained in:
IliaDenisov
2026-03-08 15:31:17 +02:00
parent e37a67bc99
commit 1c2fc30127
39 changed files with 2693 additions and 199 deletions
+24
View File
@@ -9,6 +9,15 @@ type MapItem interface {
ID() PrimitiveID
}
type styleBase uint8
const (
styleBaseFixed styleBase = iota
styleBaseThemeLine
styleBaseThemeCircle
styleBaseThemePoint
)
// Point is a point primitive in fixed-point world coordinates.
type Point struct {
Id PrimitiveID
@@ -18,6 +27,11 @@ type Point struct {
Priority int
// StyleID references a resolved style in the world's style table.
StyleID StyleID
// Theme style binding. If Base==styleBaseFixed => StyleID stays as-is across theme changes.
Base styleBase
// Override is applied relative to current theme base style (only when Base is theme* and Override is non-zero).
Override StyleOverride
Class PointClassID
// HitSlopPx expands hit-test radius in screen pixels (per-object override).
// 0 means "use primitive default".
@@ -34,6 +48,11 @@ type Line struct {
Priority int
// StyleID references a resolved style in the world's style table.
StyleID StyleID
// Theme style binding. If Base==styleBaseFixed => StyleID stays as-is across theme changes.
Base styleBase
// Override is applied relative to current theme base style (only when Base is theme* and Override is non-zero).
Override StyleOverride
Class LineClassID
// HitSlopPx expands hit-test radius in screen pixels (per-object override).
// 0 means "use primitive default".
@@ -50,6 +69,11 @@ type Circle struct {
Priority int
// StyleID references a resolved style in the world's style table.
StyleID StyleID
// Theme style binding. If Base==styleBaseFixed => StyleID stays as-is across theme changes.
Base styleBase
// Override is applied relative to current theme base style (only when Base is theme* and Override is non-zero).
Override StyleOverride
Class CircleClassID
// HitSlopPx expands hit-test radius in screen pixels (per-object override).
// 0 means "use primitive default".