Create icons for and implement right-angle rotation buttons.

This commit is contained in:
David Vierra 2015-10-08 21:03:27 -10:00
parent 8713704bcb
commit 63c578fce0
3 changed files with 63 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

View File

@ -16,7 +16,7 @@
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="icons.svg"
inkscape:export-filename="..\assets\mcedit2\icons\save_ok.png"
inkscape:export-filename="..\assets\mcedit2\icons\right_angle.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45">
<defs
@ -1010,10 +1010,10 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="4"
inkscape:cx="40.79128"
inkscape:cx="3.91628"
inkscape:cy="71.634579"
inkscape:document-units="px"
inkscape:current-layer="g4721"
inkscape:current-layer="layer30"
showgrid="false"
inkscape:window-width="1665"
inkscape:window-height="1058"
@ -2270,7 +2270,8 @@
<g
inkscape:groupmode="layer"
id="layer26"
inkscape:label="save">
inkscape:label="save"
style="display:none">
<g
style="display:inline"
id="g5666-4"
@ -2337,7 +2338,8 @@
<g
inkscape:label="save_ok"
id="g4719"
inkscape:groupmode="layer">
inkscape:groupmode="layer"
style="display:none">
<g
transform="matrix(1.6237792,0,0,1.6154453,25.705076,-82.429755)"
id="g4721"
@ -2411,7 +2413,7 @@
id="path4746"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#35fa00;fill-opacity:1;fill-rule:nonzero;stroke:#2cce00;stroke-width:1.56766689;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:9.89999962;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:0;fill-rule:nonzero;stroke:#65c035;stroke-width:7.83833482;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:9.89999962;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:0;fill-rule:nonzero;stroke:#65c035;stroke-width:7.83833504;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:9.89999962;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="M 88.5,100.75 98,113.5 123.5,87.75"
id="path4752"
inkscape:connector-curvature="0"
@ -2424,6 +2426,30 @@
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#eefde6;stroke-width:5.48683453;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:9.89999962;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
</g>
</g>
<g
inkscape:groupmode="layer"
id="layer30"
inkscape:label="right_angle">
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#eab0b0;fill-opacity:0.22023812;fill-rule:nonzero;stroke:none;stroke-width:8;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:9.89999962;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4576"
width="46.69957"
height="46.69957"
x="17.699572"
y="63.80043" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#a70000;stroke-width:8;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:9.89999962;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 17.5,64 46.5,0 0,46.5"
id="path4574"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#2b2b2b;stroke-width:8;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:9.89999962;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 17.5,17.5 0,93 93,0"
id="path4572"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" />
</g>
</g>
<g
inkscape:label="strokes"

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 153 KiB

View File

@ -12,6 +12,7 @@ from mcedit2.command import SimpleRevisionCommand
from mcedit2.imports import PendingImportNode, PendingImport
from mcedit2.rendering.scenegraph import scenenode
from mcedit2.util.load_ui import load_ui
from mcedit2.util.resources import resourcePath
from mcedit2.util.showprogress import showProgress
from mcedit2.widgets.coord_widget import CoordinateWidget
from mcedit2.widgets.layout import Column
@ -112,8 +113,38 @@ class RotationWidget(QtGui.QWidget):
self.yRotSpinBox.valueChanged.connect(self.setYRot)
self.zRotSpinBox.valueChanged.connect(self.setZRot)
icon = QtGui.QIcon(resourcePath("mcedit2/assets/mcedit2/icons/right_angle.png"))
self.xRot90Button.setIcon(icon)
self.yRot90Button.setIcon(icon)
self.zRot90Button.setIcon(icon)
self.xRot90Button.clicked.connect(self.xRot90Clicked)
self.yRot90Button.clicked.connect(self.yRot90Clicked)
self.zRot90Button.clicked.connect(self.zRot90Clicked)
self.xRot = self.yRot = self.zRot = 0
def rot90(self, angle):
if angle < 90:
angle = 90
elif angle < 180:
angle = 180
elif angle < 270:
angle = 270
else:
angle = 0
return angle
def xRot90Clicked(self):
self.setXRot(self.rot90(self.xRot))
def yRot90Clicked(self):
self.setYRot(self.rot90(self.yRot))
def zRot90Clicked(self):
self.setZRot(self.rot90(self.zRot))
rotationChanged = QtCore.Signal(object, bool)
@property