Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Prev Previous commit
Next Next commit
Clarify Logical Pixels explanation.
  • Loading branch information
ditman committed Feb 5, 2024
commit b061adaeaf98cd09625e53b490d18c503c1dcb89
8 changes: 7 additions & 1 deletion lib/web_ui/lib/src/engine/html/scene.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ class PersistedScene extends PersistedContainerSurface {

@override
void recomputeTransformAndClip() {
// The scene clip is the size of the entire window (Logical pixels).
// The scene clip is the size of the entire window **in Logical pixels**.
//
// Even though the majority of the engine uses `physicalSize`, there are some
// bits (like the HTML renderer, or dynamic view sizing) that are implemented
// using CSS, and CSS operates in logical pixels.
//
// See also: [EngineFlutterView.resize].
final ui.Size bounds = window.physicalSize / window.devicePixelRatio;
localClipBounds = ui.Rect.fromLTRB(0, 0, bounds.width, bounds.height);
projectedClip = null;
Expand Down