Commit 380e419
committed
tests: stabilize qtdragon ui-smoke preview and gcode scroll
The offscreen grab could catch qtdragon in different startup states
between runs: the 3D preview at different zooms and the gcode view at
different scroll positions. Two distinct causes:
- The preview computes its zoom once, at file-load, from the live
widget size (glnav.py set_view_p reads winfo_width/height) and
never re-fits on resize (qt5_graphics.py resizeGL only resets the
GL viewport). Under offscreen the file load can run before the
layout settles, freezing a stale zoom from a transient size.
- The gcode editor resets to the top on load, then scrolls to the
running line on line-changed; which one the grab catches is timing.
Before grabbing, normalize at the now-final widget size: re-issue the
view fit (set_current_view) so the zoom is recomputed against the fixed
layout, and pin the gcode scrollbar to the top. With this in place two
consecutive runs are pixel-identical apart from the wall-clock field, so
the reference.png is regenerated to the deterministic state.1 parent dbf80a3 commit 380e419
2 files changed
Lines changed: 37 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
84 | 108 | | |
85 | 109 | | |
86 | 110 | | |
| 111 | + | |
87 | 112 | | |
88 | 113 | | |
89 | 114 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
100 | 127 | | |
101 | 128 | | |
102 | 129 | | |
| |||
Loading
0 commit comments