Edit button group
BIN
img/btnArrowClose.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
img/btnEditOpen.xcf
Normal file
BIN
img/btnMove.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
img/btnMove.xcf
Normal file
BIN
img/btnRotate.xcf
Normal file
BIN
img/btnZoom.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
img/btnZoom.xcf
Normal file
@ -1,8 +1,10 @@
|
|||||||
var twistIncrement = Math.PI/1800;
|
var twistIncrement = Math.PI/1800;
|
||||||
|
|
||||||
var btnNew, btnPrevious, btnNext, btnOops, btnStop, btnInfo, btnRotate;
|
var btnNew, btnPrevious, btnNext, btnOops, btnStop, btnInfo;
|
||||||
var btnSettings, btnWordArt, btnZoom, btnMove, btnUpDown, btnTwist, btnShape, btnEditClosed, btnEditOpen; btnToggleVerticalShapes;
|
var btnSettings, btnWordArt;
|
||||||
var btnDiv,btnConv,btnStraight,btnSine, buttonGroupAdd, popupWordArt;
|
var btnToggleEdit, buttonGroupEdit, btnZoom, btnMove, btnRotate;
|
||||||
|
var btnToggleVerticalShapes, btnUpDown, btnTwist, btnShape, btnConv, btnStraight, btnSine, btnDiv;
|
||||||
|
var buttonGroupAdd, popupWordArt;
|
||||||
|
|
||||||
var state;
|
var state;
|
||||||
var prevState;
|
var prevState;
|
||||||
@ -34,8 +36,8 @@ function initButtonBehavior() {
|
|||||||
btnTwistRight = $("#btnTwistRight");
|
btnTwistRight = $("#btnTwistRight");
|
||||||
btnShape = $("#btnShape");
|
btnShape = $("#btnShape");
|
||||||
btnRotate = $("#btnRotate");
|
btnRotate = $("#btnRotate");
|
||||||
btnEditClosed = $("#btnEditClosed");
|
btnToggleEdit = $("#btnToggleEdit");
|
||||||
btnEditOpen = $("#btnEditOpen");
|
buttonGroupEdit = $("#buttonGroupEdit");
|
||||||
btnStraight = $("#btnStraight");
|
btnStraight = $("#btnStraight");
|
||||||
btnDiv = $("#btnDiv");
|
btnDiv = $("#btnDiv");
|
||||||
btnConv = $("#btnConv");
|
btnConv = $("#btnConv");
|
||||||
@ -59,9 +61,7 @@ function initButtonBehavior() {
|
|||||||
btnTwistRight.on("onButtonHold", onBtnTwistRight);
|
btnTwistRight.on("onButtonHold", onBtnTwistRight);
|
||||||
btnShape.on("onButtonClick", onBtnShape);
|
btnShape.on("onButtonClick", onBtnShape);
|
||||||
btnRotate.on("onButtonHold", onBtnRotate);
|
btnRotate.on("onButtonHold", onBtnRotate);
|
||||||
btnEditClosed.on("onButtonClick", onBtnEditClosed);
|
btnToggleEdit.on("onButtonClick", onBtnToggleEdit);
|
||||||
btnEditOpen.on("onButtonHold", onBtnEditOpen);
|
|
||||||
btnEditOpen.on("onButtonClick", onBtnEditOpen);
|
|
||||||
btnStraight.on("onButtonClick", onBtnStraight);
|
btnStraight.on("onButtonClick", onBtnStraight);
|
||||||
btnDiv.on("onButtonClick", onBtnDiv);
|
btnDiv.on("onButtonClick", onBtnDiv);
|
||||||
btnConv.on("onButtonClick", onBtnConv);
|
btnConv.on("onButtonClick", onBtnConv);
|
||||||
@ -74,8 +74,6 @@ function initButtonBehavior() {
|
|||||||
setSketchModified(false);
|
setSketchModified(false);
|
||||||
|
|
||||||
function onBtnToggleVerticalShapes() {
|
function onBtnToggleVerticalShapes() {
|
||||||
console.log("onBtnToggleVerticalShapes");
|
|
||||||
|
|
||||||
var btnImg;
|
var btnImg;
|
||||||
if(buttonGroupVerticalShapes.is(":hidden")) {
|
if(buttonGroupVerticalShapes.is(":hidden")) {
|
||||||
btnImg = "img/buttons/btnArrowClose.png";
|
btnImg = "img/buttons/btnArrowClose.png";
|
||||||
@ -85,7 +83,6 @@ function initButtonBehavior() {
|
|||||||
btnToggleVerticalShapes.attr("src",btnImg);
|
btnToggleVerticalShapes.attr("src",btnImg);
|
||||||
|
|
||||||
buttonGroupVerticalShapes.fadeToggle(BUTTON_GROUP_SHOW_DURATION);
|
buttonGroupVerticalShapes.fadeToggle(BUTTON_GROUP_SHOW_DURATION);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onBtnAdd() {
|
function onBtnAdd() {
|
||||||
@ -95,29 +92,32 @@ function initButtonBehavior() {
|
|||||||
function onBtnStraight() {
|
function onBtnStraight() {
|
||||||
setVerticalShape(verticalShapes.NONE);
|
setVerticalShape(verticalShapes.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onBtnDiv() {
|
function onBtnDiv() {
|
||||||
setVerticalShape(verticalShapes.DIVERGING);
|
setVerticalShape(verticalShapes.DIVERGING);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onBtnConv() {
|
function onBtnConv() {
|
||||||
setVerticalShape(verticalShapes.CONVERGING);
|
setVerticalShape(verticalShapes.CONVERGING);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onBtnSine() {
|
function onBtnSine() {
|
||||||
setVerticalShape(verticalShapes.SINUS);
|
setVerticalShape(verticalShapes.SINUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onBtnEditClosed(e,cursor) {
|
|
||||||
btnEditClosed.hide();
|
|
||||||
btnEditOpen.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
function hitTest(cursor,button,radius) {
|
function hitTest(cursor,button,radius) {
|
||||||
return distance(cursor.x,cursor.y,button.x,button.y)<radius;
|
return distance(cursor.x,cursor.y,button.x,button.y)<radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onBtnEditOpen(e,cursor) {
|
function onBtnToggleEdit() {
|
||||||
|
var btnImg;
|
||||||
|
if(buttonGroupEdit.is(":hidden")) {
|
||||||
|
btnImg = "img/buttons/btnArrowClose.png";
|
||||||
|
} else {
|
||||||
|
btnImg = "img/buttons/btnArrowOpen.png";
|
||||||
|
}
|
||||||
|
btnToggleEdit.attr("src",btnImg);
|
||||||
|
|
||||||
|
buttonGroupEdit.fadeToggle(BUTTON_GROUP_SHOW_DURATION);
|
||||||
|
}
|
||||||
|
function onBtnEditSomething(e,cursor) {
|
||||||
// image is shown as 75% of its size (for retina screens)
|
// image is shown as 75% of its size (for retina screens)
|
||||||
cursor.x /= .75;
|
cursor.x /= .75;
|
||||||
cursor.y /= .75;
|
cursor.y /= .75;
|
||||||
|
@ -118,19 +118,25 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#btnEditClosed {
|
#btnToggleEdit {
|
||||||
top: 5px;
|
top: 4px;
|
||||||
left: 5px;
|
left: 4px;
|
||||||
width: .75*31px;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
#buttonGroupEdit {
|
||||||
#btnEditOpen {
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 5px;
|
top: 5px;
|
||||||
left: 5px;
|
left: 5px;
|
||||||
width: .75*119px;
|
padding: 5px 7px 9px 8px;
|
||||||
display: none;
|
display: none;
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
#btnZoom {
|
||||||
|
clear: left;
|
||||||
|
margin: 0 2px 0 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*#btnAddOpen {
|
/*#btnAddOpen {
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 14 KiB |
BIN
www/img/buttons/btnRotate.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
www/img/buttons/btnZoom.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
@ -111,20 +111,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<canvas id="preview_tmp"></canvas>
|
<canvas id="preview_tmp"></canvas>
|
||||||
|
|
||||||
<img id="btnEditClosed" class="btn" src="img/buttons/btnEditClosed.png" />
|
<div id="buttonGroupEdit" class="buttonGroup">
|
||||||
<img id="btnEditOpen" class="btn" src="img/buttons/btnEditOpen.png" />
|
<img id="btnMove" class="btn" src="img/buttons/btnMove.png" />
|
||||||
|
<img id="btnZoom" class="btn" src="img/buttons/btnZoom.png" />
|
||||||
<div id="buttonGroupVerticalShapes" class="buttonGroup">
|
<img id="btnRotate" class="btn" src="img/buttons/btnRotate.png" />
|
||||||
<img id="btnTwistLeft" class="btn" src="img/buttons/btnTwistLeft.png" />
|
|
||||||
<img id="btnTwistRight" class="btn" src="img/buttons/btnTwistRight.png" />
|
|
||||||
<img id="btnUp" class="btn" src="img/buttons/btnUp.png" />
|
|
||||||
<img id="btnDown" class="btn" src="img/buttons/btnDown.png" />
|
|
||||||
<hr>
|
|
||||||
<img id="btnConv" class="btn" src="img/buttons/btnConv.png" />
|
|
||||||
<img id="btnDiv" class="btn" src="img/buttons/btnDiv.png" />
|
|
||||||
<img id="btnSine" class="btn" src="img/buttons/btnSine.png" />
|
|
||||||
<img id="btnStraight" class="btn" src="img/buttons/btnStraight.png" />
|
|
||||||
</div>
|
</div>
|
||||||
|
<img id="btnToggleEdit" class="btn" src="img/buttons/btnArrowOpen.png" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|