浏览代码

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

dev-tmpl
Bryan Miller 7 年前
父节点
当前提交
aceb73ceb5
共有 1 个文件被更改,包括 15 次插入0 次删除
  1. +15
    -0
      app/js/ctrls/CTRLPainter.js

+ 15
- 0
app/js/ctrls/CTRLPainter.js 查看文件



// 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);

正在加载...
取消
保存