Allow setting clone source in 2D view

This commit is contained in:
luboslenco
2020-01-15 21:34:56 +01:00
parent 2e37e3b5d5
commit dae562e20b
2 changed files with 8 additions and 3 deletions
+4 -2
View File
@@ -636,8 +636,10 @@ class UITrait {
var mouse = Input.getMouse();
var kb = Input.getKeyboard();
var setCloneSource = Context.tool == ToolClone && Operator.shortcut("alt+" + Config.keymap.action_paint);
var down = Operator.shortcut(Config.keymap.action_paint) ||
(Operator.shortcut("alt+" + Config.keymap.action_paint) && Context.tool == ToolClone) ||
setCloneSource ||
Operator.shortcut(Config.keymap.brush_ruler + "+" + Config.keymap.action_paint) ||
(Input.getPen().down() && !kb.down("alt"));
if (down) {
@@ -648,7 +650,7 @@ class UITrait {
if (mx < iron.App.w() && mx > iron.App.x() &&
my < iron.App.h() && my > iron.App.y()) {
if (Context.tool == ToolClone && kb.down("alt")) { // Clone source
if (setCloneSource) {
cloneStartX = mx;
cloneStartY = my;
}
+4 -1
View File
@@ -232,9 +232,12 @@ class UIView2D {
if (panScale > 3.0) panScale = 3.0;
}
var setCloneSource = Context.tool == ToolClone && Operator.shortcut("alt+" + Config.keymap.action_paint);
if (type == View2DLayer &&
(Operator.shortcut(Config.keymap.action_paint) ||
Operator.shortcut(Config.keymap.brush_ruler + "+" + Config.keymap.action_paint))) {
Operator.shortcut(Config.keymap.brush_ruler + "+" + Config.keymap.action_paint) ||
setCloneSource)) {
UITrait.inst.paint2d = true;
}