Browse Source

CTRLPainter now watches for offset with the combination shift+mouseleft+mousemove

dev-tmpl
Bryan Miller 5 years ago
parent
commit
aceb73ceb5
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      app/js/ctrls/CTRLPainter.js

+ 15
- 0
app/js/ctrls/CTRLPainter.js View File



// Setting-up Input controls. // Setting-up Input controls.
var input = new Input(); var input = new Input();
input.enableKeyboardInput(true);
input.enableMouseInput(true);
input.preventDefaults = true; input.preventDefaults = true;


// Mouse handling... // Mouse handling...
this.__brushColor = ci; this.__brushColor = ci;
}).bind(this); }).bind(this);
GlobalEvents.listen("active_palette_color", handle_color_change); GlobalEvents.listen("active_palette_color", handle_color_change);

var handle_offset = (function(e){
this.__offset[0] += e.x - e.lastX;
this.__offset[1] += e.y - e.lastY;
this.render();
}).bind(this);
input.listen("shift+mouseleft+mousemove", handle_offset);
} }





get onePaletteMode(){return this.__onePaletteMode;} get onePaletteMode(){return this.__onePaletteMode;}
set onePaletteMode(e){ set onePaletteMode(e){
this.__onePaletteMode = (e === true); this.__onePaletteMode = (e === true);
this.__gridEnabled = (e === true); this.__gridEnabled = (e === true);
} }





initialize(){ initialize(){
if (canvas === null){ if (canvas === null){
canvas = document.getElementById(EL_CANVAS_ID); canvas = document.getElementById(EL_CANVAS_ID);

Loading…
Cancel
Save