Unlike font and border sizes, the default stats shadow offset is 0 like --osd-shadow-offset, so it can be inherited from it by default to not make users configure it in 2 places. Since 0 and negative numbers are valid offsets, use infinity as the placeholder for unconfigured values.
Unified · Split
| @@ -175,12 +175,12 @@ Configurable Options · 174 unmodified lines | ||
| 175 | 175 | Color of the text border. |
| 176 | 176 | |
| 177 | 177 | ``shadow_x_offset`` |
| 178 | − Default: 0 | |
| 178 | + Default: same as ``--osd-shadow-offset`` | |
| 179 | 179 | |
| 180 | 180 | The horizontal distance from the text to position the shadow at. |
| 181 | 181 | |
| 182 | 182 | ``shadow_y_offset`` |
| 183 | − Default: 0 | |
| 183 | + Default: same as ``--osd-shadow-offset`` | |
| 184 | 184 | |
| 185 | 185 | The vertical distance from the text to position the shadow at. |
| 186 | 186 | |
| @@ -85,8 +85,6 @@ osd-outline-size=0 · 84 unmodified lines | ||
| 85 | 85 | osd-shadow-offset=4 |
| 86 | 86 | script-opt=console-border_size=0 |
| 87 | 87 | script-opt=stats-border_size=0 |
| 88 | −script-opt=stats-shadow_x_offset=4 | |
| 89 | −script-opt=stats-shadow_y_offset=4 | |
| 90 | 88 | |
| 91 | 89 | [sub-box] |
| 92 | 90 | sub-border-style=background-box |
| @@ -57,8 +57,8 @@ local o = { · 56 unmodified lines | ||
| 57 | 57 | font_color = "", |
| 58 | 58 | border_size = 1.65, |
| 59 | 59 | border_color = "", |
| 60 | − shadow_x_offset = 0.0, | |
| 61 | − shadow_y_offset = 0.0, | |
| 60 | + shadow_x_offset = math.huge, | |
| 61 | + shadow_y_offset = math.huge, | |
| 62 | 62 | shadow_color = "", |
| 63 | 63 | alpha = "11", |
| 64 | 64 | vidscale = "auto", |
| @@ -184,8 +184,15 @@ local function text_style() · 119 unmodified lines | ||
| 184 | 184 | style = style .. "\\4c&H" .. o.shadow_color .. "&\\4a&H" .. o.alpha .. "&" |
| 185 | 185 | end |
| 186 | 186 | |
| 187 | − return style .. "\\xshad" .. shadow_x_offset .. | |
| 188 | − "\\yshad" .. shadow_y_offset .. "}" | |
| 187 | + if o.shadow_x_offset < math.huge then | |
| 188 | + style = style .. "\\xshad" .. shadow_x_offset | |
| 189 | + end | |
| 190 | + | |
| 191 | + if o.shadow_y_offset < math.huge then | |
| 192 | + style = style .. "\\yshad" .. shadow_y_offset | |
| 193 | + end | |
| 194 | + | |
| 195 | + return style | |
| 189 | 196 | end |
| 190 | 197 | end |
| 191 | 198 | |