Keep floating window moves pixel-stable
Round fitted window frames to whole logical pixels and accumulate drag deltas from the gesture start. This prevents floating-point size noise from rebuilding window content while preserving fractional pointer movement and resizing behavior.
This commit is contained in:
@@ -162,6 +162,24 @@ void main() {
|
||||
),
|
||||
const Rect.fromLTWH(0, 0, 300, 200),
|
||||
);
|
||||
// A fractional minimum is never rounded below itself: the whole-pixel
|
||||
// frame rounds up, and when the bounds cannot hold it the bounds win.
|
||||
expect(
|
||||
fitWindowFrame(
|
||||
const Rect.fromLTWH(0, 0, 320.1, 240.4),
|
||||
const Size(1000, 800),
|
||||
const Size(320.1, 240.4),
|
||||
),
|
||||
const Rect.fromLTWH(0, 0, 321, 241),
|
||||
);
|
||||
expect(
|
||||
fitWindowFrame(
|
||||
const Rect.fromLTWH(0, 0, 320.1, 240.4),
|
||||
const Size(319.6, 239.2),
|
||||
const Size(320.1, 240.4),
|
||||
),
|
||||
const Rect.fromLTWH(0, 0, 319, 239),
|
||||
);
|
||||
const entry = WindowEntry(
|
||||
id: 'w',
|
||||
kind: 'chat',
|
||||
|
||||
Reference in New Issue
Block a user