Skip to content

Commit febc935

Browse files
committed
v1.2.1
1 parent 8ee7a15 commit febc935

3 files changed

Lines changed: 87 additions & 82 deletions

File tree

dist/inmark.js

Lines changed: 85 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -27009,59 +27009,6 @@
2700927009
isArray: isArray$1
2701027010
});
2701127011

27012-
function _defineProperty(obj, key, value) {
27013-
if (key in obj) {
27014-
Object.defineProperty(obj, key, {
27015-
value: value,
27016-
enumerable: true,
27017-
configurable: true,
27018-
writable: true
27019-
});
27020-
} else {
27021-
obj[key] = value;
27022-
}
27023-
27024-
return obj;
27025-
}
27026-
27027-
var defineProperty$1 = _defineProperty;
27028-
27029-
function ownKeys(object, enumerableOnly) {
27030-
var keys = Object.keys(object);
27031-
27032-
if (Object.getOwnPropertySymbols) {
27033-
var symbols = Object.getOwnPropertySymbols(object);
27034-
if (enumerableOnly) symbols = symbols.filter(function (sym) {
27035-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
27036-
});
27037-
keys.push.apply(keys, symbols);
27038-
}
27039-
27040-
return keys;
27041-
}
27042-
27043-
function _objectSpread2(target) {
27044-
for (var i = 1; i < arguments.length; i++) {
27045-
var source = arguments[i] != null ? arguments[i] : {};
27046-
27047-
if (i % 2) {
27048-
ownKeys(Object(source), true).forEach(function (key) {
27049-
defineProperty$1(target, key, source[key]);
27050-
});
27051-
} else if (Object.getOwnPropertyDescriptors) {
27052-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
27053-
} else {
27054-
ownKeys(Object(source)).forEach(function (key) {
27055-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
27056-
});
27057-
}
27058-
}
27059-
27060-
return target;
27061-
}
27062-
27063-
var objectSpread2 = _objectSpread2;
27064-
2706527012
var count = 0;
2706627013
var degree_out = 0,
2706727014
radian_out = 0,
@@ -27132,38 +27079,43 @@
2713227079
}, {
2713327080
key: "zoomStage",
2713427081
value: function zoomStage(scaleBy) {
27135-
this.setDrawingMode('hander');
27136-
var oldScale = this.group.scale[0];
27137-
var pos = {
27138-
x: this.ctx.canvasWidth / 2,
27139-
y: this.ctx.canvasHeight / 2
27140-
};
27141-
var mousePointTo = {
27142-
x: pos.x / oldScale - this.group.position[0] / oldScale,
27143-
y: pos.y / oldScale - this.group.position[1] / oldScale
27144-
};
27145-
var newScale = Math.max(0.05, oldScale * scaleBy);
27146-
var newPos = {
27147-
x: -(mousePointTo.x - pos.x / newScale) * newScale,
27148-
y: -(mousePointTo.y - pos.y / newScale) * newScale
27149-
};
27150-
27151-
var newAttrs = this._limitAttributes(objectSpread2(objectSpread2({}, newPos), {}, {
27152-
scale: newScale
27153-
}));
27082+
this.setDrawingMode('hander'); // const oldScale = this.group.scale[0];
27083+
// const pos = {
27084+
// x: this.ctx.canvasWidth / 2,
27085+
// y: this.ctx.canvasHeight / 2
27086+
// };
27087+
// const mousePointTo = {
27088+
// x: pos.x / oldScale - this.group.position[0] / oldScale,
27089+
// y: pos.y / oldScale - this.group.position[1] / oldScale
27090+
// };
27091+
// const newScale = Math.max(0.05, oldScale * scaleBy);
27092+
// const newPos = {
27093+
// x: -(mousePointTo.x - pos.x / newScale) * newScale,
27094+
// y: -(mousePointTo.y - pos.y / newScale) * newScale
27095+
// };
27096+
// const newAttrs = this._limitAttributes({ ...newPos, scale: newScale });
27097+
27098+
if (scaleBy === 1) {
27099+
// 先放大再还原到100%比例,拖动图片会触发无限放大或缩小
27100+
this.group.attr({
27101+
scale: [1.001, 1.001],
27102+
origin: this.getOrigin()
27103+
});
27104+
} else {
27105+
this.group.attr({
27106+
position: [0, 0],
27107+
scale: [scaleBy, scaleBy],
27108+
origin: this.getOrigin()
27109+
});
27110+
}
2715427111

27155-
this.group.attr({
27156-
position: [0, 0],
27157-
scale: [newAttrs.scale, newAttrs.scale],
27158-
origin: this.getOrigin()
27159-
});
2716027112
var d = this.group.getLocalTransform();
2716127113
this.setOffsetM(d[4]);
2716227114
this.setOffsetN(d[5]); // this._option.offsetM = d[4];
2716327115
// this._option.offsetN = d[5];
2716427116
// this._option.scale = newAttrs.scale;
2716527117

27166-
this.setScale(newAttrs.scale);
27118+
this.setScale(scaleBy);
2716727119
return this;
2716827120
}
2716927121
}, {
@@ -27931,6 +27883,59 @@
2793127883
return AbstractRender;
2793227884
}(Tools);
2793327885

27886+
function _defineProperty(obj, key, value) {
27887+
if (key in obj) {
27888+
Object.defineProperty(obj, key, {
27889+
value: value,
27890+
enumerable: true,
27891+
configurable: true,
27892+
writable: true
27893+
});
27894+
} else {
27895+
obj[key] = value;
27896+
}
27897+
27898+
return obj;
27899+
}
27900+
27901+
var defineProperty$1 = _defineProperty;
27902+
27903+
function ownKeys(object, enumerableOnly) {
27904+
var keys = Object.keys(object);
27905+
27906+
if (Object.getOwnPropertySymbols) {
27907+
var symbols = Object.getOwnPropertySymbols(object);
27908+
if (enumerableOnly) symbols = symbols.filter(function (sym) {
27909+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
27910+
});
27911+
keys.push.apply(keys, symbols);
27912+
}
27913+
27914+
return keys;
27915+
}
27916+
27917+
function _objectSpread2(target) {
27918+
for (var i = 1; i < arguments.length; i++) {
27919+
var source = arguments[i] != null ? arguments[i] : {};
27920+
27921+
if (i % 2) {
27922+
ownKeys(Object(source), true).forEach(function (key) {
27923+
defineProperty$1(target, key, source[key]);
27924+
});
27925+
} else if (Object.getOwnPropertyDescriptors) {
27926+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
27927+
} else {
27928+
ownKeys(Object(source)).forEach(function (key) {
27929+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
27930+
});
27931+
}
27932+
}
27933+
27934+
return target;
27935+
}
27936+
27937+
var objectSpread2 = _objectSpread2;
27938+
2793427939
/**
2793527940
* 默认image 默认
2793627941
*/
@@ -28220,7 +28225,7 @@
2822028225

2822128226
var image = new zrender$3.Image({
2822228227
style: {
28223-
image: url,
28228+
image: img,
2822428229
x: _this2._option.offsetX,
2822528230
y: _this2._option.offsetY,
2822628231
width: _this2._option.widthImg,
@@ -31495,7 +31500,7 @@
3149531500

3149631501
// rollup编译入口
3149731502

31498-
var version$1 = "1.2.0";
31503+
var version$1 = "1.2.1";
3149931504
console.log("inMark v".concat(version$1));
3150031505
var inMark = {
3150131506
version: version$1,

dist/inmark.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "inmark",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Image mark",
55
"main": "dist/inmark.min.js",
66
"scripts": {

0 commit comments

Comments
 (0)