[-]
[+]
|
Changed |
_service
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/poetaster/paint.git</param>
<param name="branch">master</param>
- <param name="revision">0.9.3</param>
+ <param name="revision">0.9.3-1</param>
<param name="debian">N</param>
<param name="dumb">N</param>
</service>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/paint.pro
^
|
@@ -171,11 +171,13 @@
DISTFILES += \
qml/components/ClipboardCanvas.qml \
+ qml/components/ToolbarButtonUndo.qml \
qml/glsl/compoundeye.frag \
qml/glsl/crosshatch.frag \
qml/glsl/mirror.frag \
qml/glsl/swap_RGB-BGR.frag \
qml/glsl/swap_RGB-GBR.frag \
- qml/glsl/swap_RGB-RBG.frag
- qml/icons/graphic-shader-texture.png
+ qml/glsl/swap_RGB-RBG.frag \
+ qml/icons/graphic-shader-texture.png \
+ qml/icons/icon-m-undo.svg
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/components/DrawingCanvas.qml
^
|
@@ -34,6 +34,10 @@
property alias areagMouseX: area.gMouseX
property alias areagMouseY: area.gMouseY
+ // try some
+ renderTarget: Canvas.FramebufferObject // default slower: Canvas.Image
+ renderStrategy: Canvas.Immediate // less memory: Canvas.Cooperative
+
property var brush
Connections
@@ -342,6 +346,7 @@
onReleased:
{
+
pressedAndHolded = false
if (gridVisible && gridSnapTo)
{
@@ -354,6 +359,9 @@
area.gMouseY = Math.round(mouseY)
}
+ // begin undo
+ idSaveCanvastimer.start()
+
switch (drawMode)
{
case Painter.Eraser:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/components/Toolbar1.qml
^
|
@@ -10,6 +10,16 @@
{
spacing: (parent.width - children.length*Theme.iconSizeLarge )/(children.length+1)
anchors.horizontalCenter: parent.horizontalCenter
+ ToolbarButtonUndo
+ {
+ mode: Painter.Pen
+ onClicked:
+ {
+ cancelPendingFunctions()
+ undo_draw()
+ drawMode = mode
+ }
+ }
ToolbarButton
{
|
[-]
[+]
|
Added |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/components/ToolbarButtonUndo.qml
^
|
@@ -0,0 +1,48 @@
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+import harbour.paint.PainterClass 1.0
+
+IconButton
+{
+ id: idUndoButton
+ enabled: ( (cStep+1) > 0 ) ? true : false
+
+ property int mode: Painter.None
+
+ highlighted: drawMode === mode
+
+ anchors.bottom: parent.bottom
+ icon.source: "../icons/icon-m-undo.svg"
+ icon.width: Theme.iconSizeMedium
+ icon.height: Theme.iconSizeMedium
+ height: parent.height
+ rotation: rotationSensor.angle
+ Behavior on rotation { SmoothedAnimation { duration: 500 } }
+
+ Image {
+ opacity: (idUndoButton.enabled) ? 1 : 0.4
+ anchors.centerIn: parent
+ source: "image://theme/icon-m-delete"
+ mirror: true
+ scale: 0.45
+ }
+ /*
+ onClicked: {
+ toolThicknessVisible = false
+ toolImageVisible = false
+ toolColorsPenVisible = false
+ toolColorsPageVisible = false
+ toolLineCapVisible = false
+ freeDrawCanvas.undo_draw()
+ }*/
+ /*onPressAndHold: {
+ toolThicknessVisible = false
+ toolImageVisible = false
+ toolColorsPenVisible = false
+ toolColorsPageVisible = false
+ toolSaveVisible = false
+ remorse.execute( parent, qsTr("Clear drawing?"), function() {
+ freeDrawCanvas.clear_canvas()
+ })
+ }*/
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/icons/icon-m-undo.svg
^
|
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 17.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="64px"
+ height="64px"
+ viewBox="0 0 64 64"
+ style="enable-background:new 0 0 64 64;"
+ xml:space="preserve"
+ sodipodi:docname="icon-m-undo.svg"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"><metadata
+ id="metadata13"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
+ id="defs11">
+
+
+
+</defs><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1055"
+ id="namedview9"
+ showgrid="false"
+ inkscape:zoom="2.6074563"
+ inkscape:cx="-26.838399"
+ inkscape:cy="62.103965"
+ inkscape:window-x="1920"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="Layer_1" />
+<rect
+ y="0"
+ x="-64"
+ height="64"
+ width="64"
+ style="opacity:0;fill:#ffffff"
+ id="icon-m-refresh_1_"
+ transform="scale(-1,1)" /><path
+ inkscape:connector-curvature="0"
+ id="path3"
+ d="m 32.003,51.563 c 10.77,0 19.532,-8.762 19.532,-19.53 0,-10.771 -8.762,-19.533 -19.532,-19.533 -5.048,0 -9.838,1.92 -13.489,5.406 -0.399,0.381 -0.414,1.014 -0.033,1.414 0.382,0.4 1.015,0.415 1.414,0.033 3.277,-3.129 7.578,-4.853 12.108,-4.853 9.667,0 17.532,7.865 17.532,17.533 0,9.666 -7.865,17.53 -17.532,17.53 -4.098,0 -8.086,-1.447 -11.23,-4.076 -0.426,-0.354 -1.056,-0.296 -1.409,0.126 -0.354,0.424 -0.298,1.055 0.126,1.409 3.504,2.929 7.947,4.541 12.513,4.541 z"
+ style="opacity:0.6;fill:#ffffff" />
+<path
+ sodipodi:type="star"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffff00;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path825"
+ sodipodi:sides="3"
+ sodipodi:cx="12.512194"
+ sodipodi:cy="22.196804"
+ sodipodi:r1="6.3634982"
+ sodipodi:r2="3.1817491"
+ sodipodi:arg1="-0.53783553"
+ sodipodi:arg2="0.50936202"
+ inkscape:flatsided="false"
+ inkscape:rounded="0"
+ inkscape:randomized="0"
+ d="M 17.97729,18.936922 15.290038,23.74829 12.602786,28.559657 9.7796455,23.826745 6.9565048,19.093833 12.466897,19.015377 Z"
+ inkscape:transform-center-x="7.296036"
+ inkscape:transform-center-y="-0.14735897"
+ transform="matrix(0.60165272,0.88180113,-0.97181431,0.66306869,34.714116,-8.3359631)" /></svg>
\ No newline at end of file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-paint-0.9.3.tar.bz2/qml/pages/Paint.qml
^
|
@@ -8,6 +8,8 @@
Page
{
+
+
id: page
anchors.fill: parent
@@ -33,6 +35,10 @@
}
}
+ // undo variables
+ property var imageData : []
+ property var cStep : -1
+
Connections
{
target: painter
@@ -394,6 +400,45 @@
z: layers.count - index
}
}
+ /* begin undo */
+ Timer {
+ id: idSaveCanvastimer
+ running: false
+ repeat: false
+ interval: 5
+ onTriggered: {
+ saveCurrentCanvas()
+ }
+ }
+ Timer {
+ id: idRefreshCanvastimer
+ running: false
+ repeat: false
+ interval: 10
+ onTriggered: {
+ drawingCanvas.visible = true
+ }
+ }
+
+ function saveCurrentCanvas() {
+ cStep++
+ var ctx = drawingCanvas.getContext('2d')
+ imageData[cStep+1] = ctx.getImageData( 0, 0, drawingCanvas.width, drawingCanvas.height )
+ }
+
+ function undo_draw() {
+ cStep--
+ var ctx = drawingCanvas.getContext('2d')
+ ctx.clearRect( 0, 0, drawingCanvas.width, drawingCanvas.height )
+ if ( (cStep+1) > 0) {
+ ctx.drawImage( imageData[cStep+1], 0, 0, drawingCanvas.width, drawingCanvas.height )
+
+ }
+ drawingCanvas.requestPaint()
+ drawingCanvas.visible = false
+ idRefreshCanvastimer.start() // needs to reload canvas, to show clear screen
+ }
+ /* end undo */
function textAccept()
{
|