modify scale
This commit is contained in:
parent
259498bd8d
commit
c037efc122
@ -47,19 +47,24 @@ define(
|
||||
if(this.options.enableScale) {
|
||||
var me = this;
|
||||
this.capture.on('wheel', function(e) {
|
||||
|
||||
var defaultRatio = me.options.defaultRatio || 1.2;
|
||||
var ratio = e.delta > 0 ? defaultRatio : 1 / defaultRatio;
|
||||
var toScale = me.camera.scale * ratio;
|
||||
if (
|
||||
toScale < me.options.minScale
|
||||
|| toScale > me.options.maxScale
|
||||
) {
|
||||
return;
|
||||
if (e.altKey) {
|
||||
var defaultRatio = me.options.defaultRatio || 1.2;
|
||||
var ratio = e.delta > 0 ? defaultRatio : 1 / defaultRatio;
|
||||
var toScale = me.camera.scale * ratio;
|
||||
if (
|
||||
toScale < me.options.minScale
|
||||
|| toScale > me.options.maxScale
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
me.scale(ratio, e);
|
||||
}
|
||||
else {
|
||||
var moval = e.delta > 0 ? 20 : -20;
|
||||
me.move(e.shiftKey ? moval : 0, e.shiftKey ? 0 : moval);
|
||||
me.refresh();
|
||||
}
|
||||
console.time('refresh');
|
||||
me.scale(ratio, e);
|
||||
console.timeEnd('refresh');
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -582,6 +582,14 @@ define(
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
// 此处非必须自动设置
|
||||
ascent: usWinAscent,
|
||||
descent: usWinDescent,
|
||||
sTypoAscender: usWinAscent,
|
||||
sTypoDescender: usWinDescent,
|
||||
|
||||
// 自动设置项目
|
||||
usWinAscent: usWinAscent,
|
||||
usWinDescent: -usWinDescent,
|
||||
sxHeight: sxHeight || 0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user