Added multi/drag/copy
This commit is contained in:
@@ -5,8 +5,8 @@ DOTGRID.Cursor = function () {
|
||||
this.translation = null
|
||||
this.operation = null
|
||||
|
||||
this.translate = function (from = null, to = null, multi = false) {
|
||||
if ((from || to) && this.translation == null) { this.translation = { multi: multi }; console.log('Begin translation') }
|
||||
this.translate = function (from = null, to = null, multi = false, copy = false) {
|
||||
if ((from || to) && this.translation == null) { this.translation = { multi: multi, copy: copy }; console.log('Begin translation', multi, copy) }
|
||||
|
||||
if (from) { this.translation.from = from }
|
||||
if (to) { this.translation.to = to }
|
||||
@@ -21,7 +21,7 @@ DOTGRID.Cursor = function () {
|
||||
|
||||
// Translation
|
||||
if (DOTGRID.tool.vertex_at(this.pos)) {
|
||||
this.translate(this.pos, this.pos, e.shiftKey)
|
||||
this.translate(this.pos, this.pos, e.shiftKey, e.ctrlKey || e.metaKey)
|
||||
}
|
||||
|
||||
DOTGRID.guide.update()
|
||||
@@ -55,7 +55,7 @@ DOTGRID.Cursor = function () {
|
||||
if (e.altKey) { DOTGRID.tool.remove_segments_at(this.pos); this.translate(); return }
|
||||
|
||||
if (this.translation && !is_equal(this.translation.from, this.translation.to)) {
|
||||
if (this.translation.multi) { DOTGRID.tool.translate_multi(this.translation.from, this.translation.to) } else { DOTGRID.tool.translate(this.translation.from, this.translation.to) }
|
||||
if (this.translation.copy) { DOTGRID.tool.translate_copy(this.translation.from, this.translation.to) } else if (this.translation.multi) { DOTGRID.tool.translate_multi(this.translation.from, this.translation.to) } else { DOTGRID.tool.translate(this.translation.from, this.translation.to) }
|
||||
} else if (e.target.id == 'guide') {
|
||||
DOTGRID.tool.add_vertex({ x: this.pos.x, y: this.pos.y })
|
||||
DOTGRID.picker.stop()
|
||||
|
||||
Reference in New Issue
Block a user