Skip to content

Commit

Permalink
v6.19.3 ChickenPaint Be更新。緩やかな拡縮。拡大→ 1.41倍、縮小→0.7092倍に。
Browse files Browse the repository at this point in the history
  • Loading branch information
satopian committed Jan 19, 2024
1 parent c5511d7 commit 5ce3a85
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 55 deletions.
18 changes: 14 additions & 4 deletions potiboard5/chickenpaint/js/chickenpaint.js
Original file line number Diff line number Diff line change
Expand Up @@ -20531,13 +20531,20 @@ function CPCanvas(controller) {
function zoomOnCenter(zoom) {
var width = (0, _jquery.default)(canvas).width(),
height = (0, _jquery.default)(canvas).height();
// 拡大を1.41、縮小を0.7092にした関係で、zoomが浮動小数点になるため、1倍2倍に近い時は値をまるめる
var roundedZoom = parseFloat(zoom);
if (Math.abs(roundedZoom - 1) < 0.2) {
zoom = 1;
} else if (Math.abs(roundedZoom - 2) < 0.2) {
zoom = 2;
}
zoomOnPoint(zoom, width / 2, height / 2);
}
this.zoomIn = function () {
zoomOnCenter(this.getZoom() * 2);
zoomOnCenter(this.getZoom() * 1.41);
};
this.zoomOut = function () {
zoomOnCenter(this.getZoom() * 0.5);
zoomOnCenter(this.getZoom() * 0.7092);
};
this.zoom100 = function () {
zoomOnCenter(1);
Expand Down Expand Up @@ -21039,7 +21046,9 @@ function CPCanvas(controller) {
var p = that.getOffset();
that.setOffset(p.x, -value);
});
this.setInterpolation(false);

//初期状態で、ズームのアンチエイリアスをOnに
this.setInterpolation(true);
var canvasSpacingWrapper = document.createElement("div");
canvasSpacingWrapper.className = 'chickenpaint-canvas-container-wrapper';
canvasSpacingWrapper.appendChild(canvas);
Expand Down Expand Up @@ -23694,7 +23703,8 @@ var MENU_ENTRIES = [{
action: "CPLinearInterpolation",
mnemonic: "L",
title: (0, _lang._)("Linear interpolation is used to give a smoothed looked to the picture when zoomed in"),
checkbox: true
checkbox: true,
checked: true //初期状態でズームのアンチエイリアスをOnに
}, {
name: "-"
}, {
Expand Down
Loading

0 comments on commit 5ce3a85

Please sign in to comment.