test: sample padding pixel so movestate colors survive Linux fonts
x=20 sits on a digit glyph with CI's Linux fonts, so the assert compared an antialiased glyph blend against the pure background. The padding area (border 1px + padding 6px) can never contain text on any font. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0147jE48bQUTm9AqNQApT6b2
This commit is contained in:
@@ -120,8 +120,12 @@ def test_spin_move_state_colors_actually_render(qtbot):
|
||||
spin.show()
|
||||
|
||||
def value_area_color():
|
||||
# Sample inside the left padding (1px border + 6px QSS padding), not
|
||||
# the text area: glyph positions are font-dependent and on CI's Linux
|
||||
# fonts x=20 lands on a digit of "12.40", returning an antialiased
|
||||
# glyph/background blend instead of the plain background color.
|
||||
img = spin.grab().toImage()
|
||||
return img.pixelColor(20, img.height() // 2)
|
||||
return img.pixelColor(4, img.height() // 2)
|
||||
|
||||
state.update_actual(12.0)
|
||||
neutral = value_area_color()
|
||||
|
||||
Reference in New Issue
Block a user