diff --git a/img/buttons/btnArrow.xcf b/img/buttons/btnArrow.xcf index ee0f1e9..d521847 100644 Binary files a/img/buttons/btnArrow.xcf and b/img/buttons/btnArrow.xcf differ diff --git a/img/buttons/btnHeight.xcf b/img/buttons/btnHeight.xcf new file mode 100644 index 0000000..c83e23f Binary files /dev/null and b/img/buttons/btnHeight.xcf differ diff --git a/img/buttons/btnMove.xcf b/img/buttons/btnMove.xcf index ae0c344..832a19c 100644 Binary files a/img/buttons/btnMove.xcf and b/img/buttons/btnMove.xcf differ diff --git a/img/buttons/btnTwist.xcf b/img/buttons/btnTwist.xcf new file mode 100644 index 0000000..98bd0c8 Binary files /dev/null and b/img/buttons/btnTwist.xcf differ diff --git a/js/buttonbehaviors.js b/js/buttonbehaviors.js index 06dd178..a67b6d3 100644 --- a/js/buttonbehaviors.js +++ b/js/buttonbehaviors.js @@ -3,7 +3,7 @@ var twistIncrement = Math.PI/1800; var btnNew, btnPrevious, btnNext, btnOops, btnStop, btnInfo; var btnSettings, btnWordArt; var btnToggleEdit, buttonGroupEdit, btnZoom, btnMove, btnRotate; -var btnToggleVerticalShapes, btnUpDown, btnTwist, btnShape, btnConv, btnStraight, btnSine, btnDiv; +var btnToggleVerticalShapes, btnHeight, btnTwist, btnShape, btnConv, btnStraight, btnSine, btnDiv; var buttonGroupAdd, popupWordArt; var state; @@ -27,29 +27,27 @@ function initButtonBehavior() { btnPrevious = $("#btnPrevious"); btnNext = $("#btnNext"); btnSave = $("#btnSave"); - btnWordArt = $("#btnWordArt"); - btnZoom = $("#btnZoom"); - btnUp = $("#btnUp"); - btnDown = $("#btnDown"); - btnMove = $("#btnMove"); - btnTwistLeft = $("#btnTwistLeft"); - btnTwistRight = $("#btnTwistRight"); - btnShape = $("#btnShape"); - btnRotate = $("#btnRotate"); + buttonGroupAdd = $("#buttonGroupAdd"); + btnShape = $("#btnShape"); + btnWordArt = $("#btnWordArt"); + popupWordArt = $("#popupWordArt"); + popupShape = $("#popupShape"); + popupMask = $("#popupMask"); + logoPanel = $("#logopanel"); btnToggleEdit = $("#btnToggleEdit"); buttonGroupEdit = $("#buttonGroupEdit"); + btnZoom = $("#btnZoom"); + btnMove = $("#btnMove"); + btnRotate = $("#btnRotate"); + btnToggleVerticalShapes = $("#btnToggleVerticalShapes"); + buttonGroupVerticalShapes = $("#buttonGroupVerticalShapes"); + btnHeight = $("#btnHeight"); + btnTwist = $("#btnTwist"); btnStraight = $("#btnStraight"); btnDiv = $("#btnDiv"); btnConv = $("#btnConv"); btnSine = $("#btnSine"); btnAdd = $("#btnAdd"); - btnToggleVerticalShapes = $("#btnToggleVerticalShapes"); - buttonGroupAdd = $("#buttonGroupAdd"); - buttonGroupVerticalShapes = $("#buttonGroupVerticalShapes"); - popupWordArt = $("#popupWordArt"); - popupShape = $("#popupShape"); - popupMask = $("#popupMask"); - logoPanel = $("#logopanel"); logoPanel.on("onButtonClick", onLogo); btnNew.on("onButtonClick", onBtnNew); @@ -60,10 +58,8 @@ function initButtonBehavior() { btnOops.on("onButtonHold", onBtnOops); // vertical shape buttons btnToggleVerticalShapes.on("onButtonClick", onBtnToggleVerticalShapes); - btnUp.on("onButtonHold", onBtnUp); - btnDown.on("onButtonHold", onBtnDown); - btnTwistLeft.on("onButtonHold", onBtnTwistLeft); - btnTwistRight.on("onButtonHold", onBtnTwistRight); + btnHeight.on("onButtonHold", onBtnHeight); + btnTwist.on("onButtonHold", onBtnTwist); btnStraight.on("onButtonClick", onBtnStraight); btnDiv.on("onButtonClick", onBtnDiv); btnConv.on("onButtonClick", onBtnConv); @@ -141,25 +137,21 @@ function initButtonBehavior() { function onBtnRotate(e,cursor) { var h = btnZoom.height(); var multiplier = (h/2-cursor.y)*0.003; - rotateShape(-multiplier); - //if (cursor.y<25) rotateShape(.1); - //else if (cursor.y>55) rotateShape(-.1); + rotateShape(-multiplier); } - - function onBtnUp(e) { - previewUp(true); + + function onBtnHeight(e,cursor) { + var h = btnHeight.height(); + if(cursor.y < h/2) { + previewUp(true); + } else { + previewDown(true); + } } - - function onBtnDown(e) { - previewDown(true); - } - - function onBtnTwistLeft(e) { - previewTwistLeft(true); - } - - function onBtnTwistRight(e) { - previewTwistRight(true); + function onBtnTwist(e,cursor) { + var h = btnTwist.height(); + var multiplier = (cursor.y-h/2)*0.0005; + previewTwist(multiplier,true); } function onBtnOops(e) { @@ -313,17 +305,19 @@ function previewDown(redrawLess) { redrawRenderedPreview(redrawLess); } function previewTwistLeft(redrawLess) { - if (redrawLess == undefined) redrawLess = false; - // console.log("f:previewTwistLeft()"); - if (rStep > -previewRotationLimit) rStep -= twistIncrement; - // redrawPreview(redrawLess); - redrawRenderedPreview(redrawLess); - setSketchModified(true); + previewTwist(-twistIncrement,true) } function previewTwistRight(redrawLess) { - // console.log("f:previewTwistRight()"); - if (rStep < previewRotationLimit) rStep += twistIncrement; - // redrawPreview(redrawLess); + previewTwist(twistIncrement,true) +} +function previewTwist(increment,redrawLess) { + console.log("previewTwist: ",increment); + if (redrawLess == undefined) redrawLess = false; + + rStep += increment; + if(rStep < -previewRotationLimit) rStep = -previewRotationLimit; + else if(rStep > previewRotationLimit) rStep = previewRotationLimit; + redrawRenderedPreview(redrawLess); setSketchModified(true); } diff --git a/less/buttons.less b/less/buttons.less index 016d3c5..e492f09 100644 --- a/less/buttons.less +++ b/less/buttons.less @@ -161,7 +161,8 @@ }*/ .buttonGroup { - background-color: white; + /*background-color: white;*/ + background-color: #fff; position: absolute; border: 3px solid black; border-radius: 40px; @@ -185,7 +186,7 @@ #buttonGroupVerticalShapes { top: 7px; left: 8px; - padding-top: 20px; + padding: 12px 7px 7px 9px; width: 65px; .btn { diff --git a/www/img/buttons/btnArrowClose.png b/www/img/buttons/btnArrowClose.png index aa49395..38db14f 100644 Binary files a/www/img/buttons/btnArrowClose.png and b/www/img/buttons/btnArrowClose.png differ diff --git a/www/img/buttons/btnHeight.png b/www/img/buttons/btnHeight.png new file mode 100644 index 0000000..ecdd343 Binary files /dev/null and b/www/img/buttons/btnHeight.png differ diff --git a/www/img/buttons/btnTwist.png b/www/img/buttons/btnTwist.png new file mode 100644 index 0000000..f40f373 Binary files /dev/null and b/www/img/buttons/btnTwist.png differ diff --git a/www/index.html b/www/index.html index a3b5210..84daae0 100644 --- a/www/index.html +++ b/www/index.html @@ -56,18 +56,6 @@ - - -
@@ -95,15 +83,14 @@
- - - - -
- - - - + + +
+ + + + +