diff --git a/js/ChickenPaint.js b/js/ChickenPaint.js index 7327937..51812ca 100644 --- a/js/ChickenPaint.js +++ b/js/ChickenPaint.js @@ -442,6 +442,7 @@ export default function ChickenPaint(options) { CPRectSelection: new ModeChangeAction(ChickenPaint.M_RECT_SELECTION), CPMoveTool: new ModeChangeAction(ChickenPaint.M_MOVE_TOOL), CPRotateCanvas: new ModeChangeAction(ChickenPaint.M_ROTATE_CANVAS), + CPPanCanvas: new ModeChangeAction(ChickenPaint.M_PAN_CANVAS), CPColorPicker: new ModeChangeAction(ChickenPaint.M_COLOR_PICKER), // Layer transform @@ -1401,6 +1402,7 @@ ChickenPaint.M_ROTATE_CANVAS = 4; ChickenPaint.M_COLOR_PICKER = 5; ChickenPaint.M_GRADIENTFILL = 6; ChickenPaint.M_TRANSFORM = 7; +ChickenPaint.M_PAN_CANVAS = 8; // // Definition of all the standard tools available diff --git a/js/gui/CPCanvas.js b/js/gui/CPCanvas.js index cdcd680..4bdbad5 100644 --- a/js/gui/CPCanvas.js +++ b/js/gui/CPCanvas.js @@ -879,7 +879,7 @@ export default function CPCanvas(controller) { CPColorPickerMode.prototype = Object.create(CPMode.prototype); CPColorPickerMode.prototype.constructor = CPColorPickerMode; - function CPPanMode() { + function CPPanCanvasMode() { var panningX, panningY, panningOffset, @@ -909,7 +909,8 @@ export default function CPCanvas(controller) { this.mouseDown = function(e, button, pressure) { if (this.capture) { return true; - } else if (button == BUTTON_WHEEL || key.isPressed("space") && button == BUTTON_PRIMARY) { + } else if (button == BUTTON_WHEEL || key.isPressed("space") && button == BUTTON_PRIMARY + || !this.transient && button == BUTTON_PRIMARY) { this.capture = true; panningButton = button; panningX = e.pageX; @@ -952,8 +953,8 @@ export default function CPCanvas(controller) { }; } - CPPanMode.prototype = Object.create(CPMode.prototype); - CPPanMode.prototype.constructor = CPFloodFillMode; + CPPanCanvasMode.prototype = Object.create(CPMode.prototype); + CPPanCanvasMode.prototype.constructor = CPPanCanvasMode; function CPFloodFillMode() { } @@ -2493,7 +2494,11 @@ export default function CPCanvas(controller) { case ChickenPaint.M_ROTATE_CANVAS: newMode = rotateCanvasMode; break; - + + case ChickenPaint.M_PAN_CANVAS: + newMode = panMode; + break; + case ChickenPaint.M_COLOR_PICKER: newMode = colorPickerMode; break; @@ -2530,7 +2535,7 @@ export default function CPCanvas(controller) { defaultMode = new CPDefaultMode(); colorPickerMode = new CPColorPickerMode(); - panMode = new CPPanMode(); + panMode = new CPPanCanvasMode(); rotateCanvasMode = new CPRotateCanvasMode(); floodFillMode = new CPFloodFillMode(); gradientFillMode = new CPGradientFillMode(); diff --git a/js/gui/CPToolPalette.js b/js/gui/CPToolPalette.js index 088cfed..743fdf1 100644 --- a/js/gui/CPToolPalette.js +++ b/js/gui/CPToolPalette.js @@ -71,11 +71,11 @@ export default function CPToolPalette(cpController) { mode: ChickenPaint.M_COLOR_PICKER }, { - className: "chickenpaint-tool-rotate-canvas", - command: "CPRotateCanvas", - commandDoubleClick: "CPResetCanvasRotation", - toolTip: "Rotate canvas", - mode: ChickenPaint.M_ROTATE_CANVAS + className: "chickenpaint-tool-blur", + command: "CPBlur", + toolTip: "Blur", + mode: ChickenPaint.M_DRAW, + tool: ChickenPaint.T_BLUR }, { className: "chickenpaint-tool-pencil", @@ -152,12 +152,18 @@ export default function CPToolPalette(cpController) { tool: ChickenPaint.T_BURN }, { - className: "chickenpaint-tool-blur", - command: "CPBlur", - toolTip: "Blur", - mode: ChickenPaint.M_DRAW, - tool: ChickenPaint.T_BLUR - } + className: "chickenpaint-tool-rotate-canvas", + command: "CPRotateCanvas", + commandDoubleClick: "CPResetCanvasRotation", + toolTip: "Rotate canvas", + mode: ChickenPaint.M_ROTATE_CANVAS + }, + { + className: "chickenpaint-tool-pan-canvas", + command: "CPPanCanvas", + toolTip: "Grab canvas", + mode: ChickenPaint.M_PAN_CANVAS + }, ], listElem = document.createElement("ul"); diff --git a/js/languages/ja.json b/js/languages/ja.json index 2ad90a9..3a9d8d9 100644 --- a/js/languages/ja.json +++ b/js/languages/ja.json @@ -136,6 +136,7 @@ "Gradient fill": "グラデーション", "Color picker": "スポイト", "Rotate canvas": "キャンバスの回転", + "Grab canvas": "キャンバスの位置", "Pencil": "鉛筆", "Pen": "ペン", "Airbrush": "エアブラシ", diff --git a/resources/css/chickenpaint.scss b/resources/css/chickenpaint.scss index f1a38a2..0f7017b 100644 --- a/resources/css/chickenpaint.scss +++ b/resources/css/chickenpaint.scss @@ -370,6 +370,9 @@ .chickenpaint-tool-rotate-canvas .chickenpaint-toolbar-button-icon { background-position:0 -928px; } +.chickenpaint-tool-pan-canvas .chickenpaint-toolbar-button-icon { + background-position:0 -672px; +} .chickenpaint-tool-pencil .chickenpaint-toolbar-button-icon { background-position:0 -160px; } diff --git a/resources/gfx/icons-2x.png b/resources/gfx/icons-2x.png index adb8917..8c5c09b 100644 Binary files a/resources/gfx/icons-2x.png and b/resources/gfx/icons-2x.png differ diff --git a/resources/gfx/icons-2x.psd b/resources/gfx/icons-2x.psd index 44cfa36..fffb68a 100644 Binary files a/resources/gfx/icons-2x.psd and b/resources/gfx/icons-2x.psd differ diff --git a/resources/gfx/icons-ja-2x.png b/resources/gfx/icons-ja-2x.png index 80423b6..e192bb2 100644 Binary files a/resources/gfx/icons-ja-2x.png and b/resources/gfx/icons-ja-2x.png differ diff --git a/resources/gfx/icons-ja-2x.psd b/resources/gfx/icons-ja-2x.psd index be5e20d..0b8c928 100644 Binary files a/resources/gfx/icons-ja-2x.psd and b/resources/gfx/icons-ja-2x.psd differ diff --git a/resources/gfx/icons-ja.png b/resources/gfx/icons-ja.png index d691c70..7649b0a 100644 Binary files a/resources/gfx/icons-ja.png and b/resources/gfx/icons-ja.png differ diff --git a/resources/gfx/icons-ja.psd b/resources/gfx/icons-ja.psd index 9043b3f..f7d36e1 100644 Binary files a/resources/gfx/icons-ja.psd and b/resources/gfx/icons-ja.psd differ diff --git a/resources/gfx/icons.png b/resources/gfx/icons.png index 5b9d3ea..8173fa6 100644 Binary files a/resources/gfx/icons.png and b/resources/gfx/icons.png differ diff --git a/resources/gfx/icons.psd b/resources/gfx/icons.psd index 11baceb..50aa381 100644 Binary files a/resources/gfx/icons.psd and b/resources/gfx/icons.psd differ diff --git a/resources/gfx/iconstext.psd b/resources/gfx/iconstext.psd deleted file mode 100644 index 450b2dd..0000000 Binary files a/resources/gfx/iconstext.psd and /dev/null differ diff --git a/resources/gfx/smallicons.png b/resources/gfx/smallicons.png deleted file mode 100644 index 85a7f88..0000000 Binary files a/resources/gfx/smallicons.png and /dev/null differ diff --git a/resources/gfx/smallicons.psd b/resources/gfx/smallicons.psd deleted file mode 100644 index f29b1bf..0000000 Binary files a/resources/gfx/smallicons.psd and /dev/null differ