Skip to content

Commit

Permalink
Prevent applying nub/stepped/ghost to decals (and vice-versa)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Prest committed Aug 5, 2015
1 parent 362b1bb commit 1f8640f
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions kb.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,16 +569,20 @@
textSize : function() { if(index<0) { key.default.textSize = value; key.textSize = []; } else { key.textSize[index] = value; } },
labels : function() { key.labels[index] = value; },
stepped : function() {
key[prop] = value;
if(value && key.width === key.width2) {
if(key.width > 1) {
key.width = Math.max(1, key.width-0.5);
} else {
key.width2 = key.width+0.5;
if(!key.decal) {
key[prop] = value;
if(value && key.width === key.width2) {
if(key.width > 1) {
key.width = Math.max(1, key.width-0.5);
} else {
key.width2 = key.width+0.5;
}
}
}
},
decal : function() { key[prop] = value; key.x2 = key.y2 = 0; key.width2 = key.width; key.height2 = key.height; },
nub : function() { if(!key.decal) key[prop] = value; },
ghost : function() { if(!key.decal) key[prop] = value; },
decal : function() { key[prop] = value; key.x2 = key.y2 = 0; key.width2 = key.width; key.height2 = key.height; key.nub = key.stepped = key.ghost = false; },
rotation_angle : function() { key.rotation_angle = value; key.rotation_x = $scope.multi.rotation_x; key.rotation_y = $scope.multi.rotation_y; },
};
return (u[prop] || u._)();
Expand Down

0 comments on commit 1f8640f

Please sign in to comment.