From 1f8640f7395942bfdd19e50dd2f93d49918b443c Mon Sep 17 00:00:00 2001 From: Ian Prest Date: Wed, 5 Aug 2015 00:08:13 -0400 Subject: [PATCH] Prevent applying nub/stepped/ghost to decals (and vice-versa) --- kb.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/kb.js b/kb.js index 357885e..a093fea 100644 --- a/kb.js +++ b/kb.js @@ -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._)();