Skip to content

Commit

Permalink
Fix Path hit test code for high dpi devices (flutter#17608)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferhatb authored Apr 10, 2020
1 parent 262723a commit 6b06529
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/web_ui/lib/src/engine/surface/painting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,9 @@ class SurfacePath implements ui.Path {
EngineWindow.browserDevicePixelRatio) {
_rawRecorder = null;
}
_rawRecorder ??= ui.RawRecordingCanvas(size);
final double dpr = window.devicePixelRatio;
_rawRecorder ??= ui.RawRecordingCanvas(ui.Size(size.width / dpr,
size.height / dpr));
// Account for the shift due to padding.
_rawRecorder.translate(-BitmapCanvas.kPaddingPixels.toDouble(),
-BitmapCanvas.kPaddingPixels.toDouble());
Expand Down

0 comments on commit 6b06529

Please sign in to comment.