mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-28 18:15:37 -05:00
Set screen matrix scale to Paint.currentZoom
This commit is contained in:
parent
2a40e17247
commit
650157bc7a
1 changed files with 3 additions and 5 deletions
|
@ -1139,12 +1139,10 @@ export default class PaintAction {
|
|||
pt2.x = pt.x;
|
||||
pt2.y = pt.y;
|
||||
var screenMatrix = Paint.root.getScreenCTM();
|
||||
// screenMatrix should include the currentScale, apply scaling
|
||||
screenMatrix.a = Paint.currentZoom;
|
||||
screenMatrix.d = Paint.currentZoom;
|
||||
var globalPoint = pt2.matrixTransform(screenMatrix.inverse());
|
||||
// screenMatrix should include the currentScale, if it doesn't match, apply scaling
|
||||
if (screenMatrix.a != Paint.currentZoom) {
|
||||
globalPoint.x = globalPoint.x / Paint.currentZoom;
|
||||
globalPoint.y = globalPoint.y / Paint.currentZoom;
|
||||
}
|
||||
return globalPoint;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue