Fix devicepixel ratio reset problem when replaying clip stack (flutter/engine#15327)
* Fix devicepixel ratio reset problem when replaying clip stack * Simplify setTransform
This commit is contained in:
@@ -140,7 +140,9 @@ class _CanvasPool extends _SaveStackTracking {
|
|||||||
int clipDepth, Matrix4 transform, List<_SaveClipEntry> clipStack) {
|
int clipDepth, Matrix4 transform, List<_SaveClipEntry> clipStack) {
|
||||||
final html.CanvasRenderingContext2D ctx = _context;
|
final html.CanvasRenderingContext2D ctx = _context;
|
||||||
if (!transform.isIdentity()) {
|
if (!transform.isIdentity()) {
|
||||||
ctx.setTransform(transform[0], transform[1], transform[4], transform[5],
|
final double ratio = EngineWindow.browserDevicePixelRatio;
|
||||||
|
ctx.setTransform(ratio, 0, 0, ratio, 0, 0);
|
||||||
|
ctx.transform(transform[0], transform[1], transform[4], transform[5],
|
||||||
transform[12], transform[13]);
|
transform[12], transform[13]);
|
||||||
}
|
}
|
||||||
if (clipStack != null) {
|
if (clipStack != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user