modify scale

This commit is contained in:
mkwiser 2014-10-13 00:38:46 +08:00
parent 259498bd8d
commit c037efc122
2 changed files with 25 additions and 12 deletions

View File

@ -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');
});
}

View File

@ -582,6 +582,14 @@ define(
});
return {
// 此处非必须自动设置
ascent: usWinAscent,
descent: usWinDescent,
sTypoAscender: usWinAscent,
sTypoDescender: usWinDescent,
// 自动设置项目
usWinAscent: usWinAscent,
usWinDescent: -usWinDescent,
sxHeight: sxHeight || 0,