From 7383f73a5b1589d3257b44407e46adfe987e2530 Mon Sep 17 00:00:00 2001 From: Physcik Date: Mon, 2 Feb 2026 02:00:29 +0500 Subject: Span system rework pt 1 --- engine/UI/Style.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'engine/UI/Style.go') diff --git a/engine/UI/Style.go b/engine/UI/Style.go index 091a6a3..1e05bcf 100644 --- a/engine/UI/Style.go +++ b/engine/UI/Style.go @@ -29,3 +29,12 @@ func (base *Style) FillMissing(defaultStyle *Style) { base.Roundness = defaultLabelStyle.Roundness } } + +// Ensures that the provided style is not nil and fills in gaps with default style +func InitStyle(provided *Style, defaultStyle *Style) *Style { + if provided == nil { + return defaultStyle + } + provided.FillMissing(defaultStyle) + return provided +} -- cgit v1.3