Don't bully people that's mean
Bully cursors into inheriting a global cursor for resizing.
😈
main
parent
ab3c8d2438
commit
e8d5de2735
10
$Handles.js
10
$Handles.js
|
@ -67,13 +67,11 @@ function $Handles($container, canvas, options){
|
||||||
dragged = false;
|
dragged = false;
|
||||||
if(e.button === 0){
|
if(e.button === 0){
|
||||||
$G.on("mousemove", drag);
|
$G.on("mousemove", drag);
|
||||||
$body.css({cursor:cursor});
|
$body.css({cursor:cursor}).addClass("jspaint-cursor-bully");
|
||||||
$(canvas).css({pointerEvents:"none"});
|
|
||||||
}
|
}
|
||||||
$G.one("mouseup", function(e){
|
$G.one("mouseup", function(e){
|
||||||
$G.off("mousemove", drag);
|
$G.off("mousemove", drag);
|
||||||
$body.css({cursor:"auto"});
|
$body.css({cursor:""}).removeClass("jspaint-cursor-bully");
|
||||||
$(canvas).css({pointerEvents:""});
|
|
||||||
|
|
||||||
$resize_ghost.remove();
|
$resize_ghost.remove();
|
||||||
if(dragged){
|
if(dragged){
|
||||||
|
@ -82,6 +80,10 @@ function $Handles($container, canvas, options){
|
||||||
$container.trigger("update");
|
$container.trigger("update");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
$h.on("mousedown selectstart", function(e){
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var update_handle = function(){
|
var update_handle = function(){
|
||||||
|
|
|
@ -61,6 +61,8 @@ Selection.prototype.instantiate = function(_img, _passive){
|
||||||
}
|
}
|
||||||
sel.$ghost.append(sel.canvas);
|
sel.$ghost.append(sel.canvas);
|
||||||
|
|
||||||
|
//sel.$handles = $Handles(sel.$ghost, sel.canvas, {outset: 2});
|
||||||
|
|
||||||
var mox, moy;
|
var mox, moy;
|
||||||
var mousemove = function(e){
|
var mousemove = function(e){
|
||||||
var m = e2c(e);
|
var m = e2c(e);
|
||||||
|
|
|
@ -89,6 +89,8 @@ TextBox.prototype.instantiate = function(){
|
||||||
tb.$ghost.append(tb.$editor);
|
tb.$ghost.append(tb.$editor);
|
||||||
tb.$editor.focus();
|
tb.$editor.focus();
|
||||||
|
|
||||||
|
//tb.$handles = $Handles(tb.$ghost, tb.$editor[0], {outset: 2});
|
||||||
|
|
||||||
var mox, moy;
|
var mox, moy;
|
||||||
var mousemove = function(e){
|
var mousemove = function(e){
|
||||||
var m = e2c(e);
|
var m = e2c(e);
|
||||||
|
|
|
@ -23,6 +23,9 @@
|
||||||
outline: 1px dotted #7b7b7b; /* what it is */
|
outline: 1px dotted #7b7b7b; /* what it is */
|
||||||
outline: 1px dotted invert; /* what it should be */
|
outline: 1px dotted invert; /* what it should be */
|
||||||
}
|
}
|
||||||
|
.jspaint-cursor-bully * {
|
||||||
|
cursor: inherit !important;
|
||||||
|
}
|
||||||
|
|
||||||
.jspaint-menus * {
|
.jspaint-menus * {
|
||||||
font: menu;
|
font: menu;
|
||||||
|
|
Loading…
Reference in New Issue