resetStyleSettings reverses the effects of [ApplyStyleSettings] for the widget's font size so that it does not create cascading inhereted font size values. It only does this for non-root elements, as the root element must receive the larger font size so that all other widgets inherit it. It must be
()
| 113 | // all other widgets inherit it. It must be called before |
| 114 | // [WidgetBase.runStylers] and [WidgetBase.styleSettings]. |
| 115 | func (wb *WidgetBase) resetStyleSettings() { |
| 116 | if tree.IsRoot(wb) { |
| 117 | return |
| 118 | } |
| 119 | fsz := AppearanceSettings.FontSize / 100 |
| 120 | wb.Styles.Font.Size.Value /= fsz |
| 121 | wb.Styles.Text.LineHeight.Value /= fsz |
| 122 | } |
| 123 | |
| 124 | // styleSettings applies [AppearanceSettingsData.Spacing] |
| 125 | // and [AppearanceSettings.FontSize] to the style values for the widget. |