Skip to content

Commit be66183

Browse files
committed
ошибка paperjs paperjs/paper.js#2048
1 parent 9968e16 commit be66183

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/editor/zoom.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
// ошибка в paper-core
3+
(() => {
4+
function getZoom() {
5+
const scaling = this._decompose().scaling;
6+
return (Math.abs(scaling.x) + Math.abs(scaling.y)) / 2;
7+
}
8+
const {prototype} = paper.View;
9+
prototype.getZoom = getZoom
10+
const setZoom = Object.getOwnPropertyDescriptor(prototype, 'zoom').set;
11+
delete prototype.zoom;
12+
Object.defineProperty(prototype, 'zoom', {
13+
get: getZoom,
14+
set: setZoom,
15+
})
16+
})();

0 commit comments

Comments
 (0)