Skip to content

Commit 2f683bd

Browse files
committed
style setter: do not copy source StyleSetter
after a deeper thinking I've considered this makes no sense to copy source
1 parent a2ce0c8 commit 2f683bd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

StyleSetter.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,13 @@ func Style() *StyleSetter {
3838
}
3939

4040
// Add merges two StyleSetters.
41-
// It does not modify neither "ss" nor "other" StyleSetters.
4241
// Add puts other "on top" of ss, meaning, "other" is applied after "ss".
4342
// e.g. if both StyleSetters set imgui.StyleVarAlpha, the value from "other" will be used.
4443
// NOTE: font value "nil" is treated as "not set" and will not be changed if declared by other.
4544
// NOTE: true is preffered over false for disabled field.
4645
// NOTE: layout field will be reset.
4746
func (ss *StyleSetter) Add(other *StyleSetter) *StyleSetter {
48-
result := *ss
47+
result := ss
4948
for k, v := range other.colors {
5049
result.colors[k] = v
5150
}
@@ -72,7 +71,7 @@ func (ss *StyleSetter) Add(other *StyleSetter) *StyleSetter {
7271

7372
result.layout = nil
7473

75-
return &result
74+
return result
7675
}
7776

7877
// SetColor sets colorID's color.

0 commit comments

Comments
 (0)