Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Area.py
Commit message (Collapse)AuthorAgeFilesLines
* One line pep8 fixGonzalo Odiard2012-10-311-0/+1
|
* Fix freeform tool use with touch - part of SL#4074Gonzalo Odiard2012-10-311-14/+9
| | | | | | | To do easier show where the freeform will be closed, a circle is displayed. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Fix selections movement/resize with touch - part of SL#4074Gonzalo Odiard2012-10-311-0/+7
| | | | | | | This patch ignore mousemove emulated events triggered by touch events because confuses selections operations. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Fix osk interaction with text tool - SL #4105Gonzalo Odiard2012-10-311-40/+29
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Fix c bucket implementation - SL #4073Gonzalo Odiard2012-10-301-48/+42
| | | | | | | | | The c implementation is reworked to process a array with the surface data instead of the GdkImage. It returns a list instead of a array The c do not depends on gtk anymore. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Resize the textview area when change font - SL #4078Gonzalo Odiard2012-10-251-0/+3
| | | | | | | This patch also solves a problem when close the activity while a text is being edited. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Fix pick tool - SL #4077Gonzalo Odiard2012-10-241-1/+1
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Use touch events - SL #4004Gonzalo Odiard2012-10-191-60/+101
| | | | | | This patch does not solve the tools selection and freeform Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Fix copy/paste functionality - SL #3938Gonzalo Odiard2012-10-191-56/+17
| | | | | | | | | We can't use set_with_data [1], then use the set_image method A fix to not clean the background after paste is included too. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org> https://bugzilla.gnome.org/show_bug.cgi?id=656312
* Mirror code updatedGonzalo Odiard2012-10-021-4/+59
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Rotate using cairoGonzalo Odiard2012-10-021-13/+31
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Fix simple pep8Gonzalo Odiard2012-10-021-0/+2
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Use a similar surface to improve performanceGonzalo Odiard2012-10-021-35/+59
| | | | | | | | | | As the surface is created in draw callback, we need delay some operations until the surface is created. The undo keep is delayed until finish draw, then enable_undo() now only enable a flag, and a new method keep_undo() do the real task. This patch breaks rotation and mirror, will be adressed in another patch. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Show the text color while editing - SL #3929Gonzalo Odiard2012-09-201-1/+3
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Text in XO is at the wrong size - SL #3850Gonzalo Odiard2012-09-201-0/+13
| | | | | | Needed set the dpi with PangoCairo Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Do te resize visualy in the canvasGonzalo Odiard2012-09-041-14/+29
| | | | | | | Remove the spinbuttons in the image toolbar, and handle the visual representation in the canvas Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Display a resize handlw in selectionsGonzalo Odiard2012-09-041-11/+38
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Fix rotation of selectionsGonzalo Odiard2012-09-041-3/+28
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Apply the selection over the temp canvas on mouseoutGonzalo Odiard2012-09-041-8/+36
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Enlarge the damaged area - SL #3794Gonzalo Odiard2012-08-101-4/+4
| | | | | | | | | | When drawing stars (and arrows) and the line size is big, the damaged area calculated was not enough and the shape was croped. This patch add line_size * 2 to the calculated area based in the points. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Fix invert color tool after porting to gtk3 - SL #3791Gonzalo Odiard2012-08-101-34/+28
| | | | | | | Now is not using pixbuf anymore, but using the surface data as in flood_fill. Gtk3 binding does not have pixbuf.get_pixels_array anymore. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Undo fixed SL #3105Manuel Kaufmann2012-08-101-0/+5
| | | | | | | | Remove the obsolete "redos" when the user clicks many times on "undo" and after that draws anything again. I mean, it's in the middle of the "undo" list and start drawing again. Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
* Initial version of port to gtk3Gonzalo Odiard2012-08-101-138/+148
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Fix artifact when using stamp toolGonzalo Odiard2012-08-101-5/+12
| | | | | | | The damaged area was calculated baased in the brush size instead of using the stamp size Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Fix artifact in the circle brush shapeGonzalo Odiard2012-08-101-2/+0
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Add slider to set the alpha, and change size brush spinbutton by a sliderGonzalo Odiard2012-08-101-4/+21
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Use clipping to improve performance in the slower operationsGonzalo Odiard2012-08-101-18/+49
| | | | | | | | | The port to cairo is a lot slower (in a xo) than using the old primitives. Previously we was painting all the screen in most of the operations. This patch calculate and apply clip over most of them and add comments "TODO: clip" in the remaining. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Use the polygon method to repalce the trace codeGonzalo Odiard2012-08-101-2/+1
| | | | | | | | | Trace code was used by brush, eraser and rainbow tools. Was replaced in the brush and eraser tools, due to artifacts when the alpha is not 1.0 The rainbow tools continue using the old code (renamed to _old_trace) Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Pylint fixesGonzalo Odiard2012-08-101-39/+28
| | | | | | Mostly remove unused code, and replacing window by get_window() Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Remove temporary loggingGonzalo Odiard2012-08-101-8/+2
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Use cairo surfaces instead of pixbuf to undo/redoGonzalo Odiard2012-08-101-7/+19
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Implement flood_fill tool using cairo.Gonzalo Odiard2012-08-101-26/+39
| | | | | | | Only the slow python implementation is done, the code used to import the c version is commented. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Remove unused code calling the pixmapGonzalo Odiard2012-08-101-10/+0
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Text tool ported to cairoGonzalo Odiard2012-08-101-7/+18
| | | | | | | This patch reorganize a little the text management code, to do the font_properties private to Area. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Resize of selections use cairoGonzalo Odiard2012-08-101-6/+44
| | | | Singled-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Implement undo/redo using cairoGonzalo Odiard2012-08-101-63/+37
| | | | | | | | | | | The stored images are pixbuf instead of pixmaps now. Created two methods _surface_to_pixbuf and _pixbuf_to_context to copy from/to pixtuf/surfaces because the code was used in a few places. enableUndo was renamed to enable_undo too and unneded parameters removed. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Implement stamp tool with cairoGonzalo Odiard2012-08-101-5/+6
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Improve visualization of selection border in a black backgroundGonzalo Odiard2012-08-101-1/+4
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Use cairo to pick_color and draw the brush preview widgetGonzalo Odiard2012-08-101-6/+16
| | | | | | Is pending the part of the stamp display in the brush button Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Rotate method ported to cairoGonzalo Odiard2012-08-101-58/+30
| | | | Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* Pep8 fixesGonzalo Odiard2012-08-101-3/+3
|
* Port effects functionality to cairoGonzalo Odiard2012-08-101-32/+22
| | | | | Grayscale, invert colors and mirror are implemented in this patch. NOTE: Invert colors is showing artifacts.
* Initial phase of clipboard operations ported to cairoGonzalo Odiard2012-08-101-209/+183
| | | | | | | | | | | | | | | | | Copy, paste and move operations are implemented. NOTES: * Change size of selection is not implemented in this patch. * A refactoring was done to do the code easier to understand. Previously, the Area.selmove was used to check if a selection is in progress. Now only to check if a area is being moved. A selection is detected using Area.is_selected(). The propery selmove now is private _selmove. The selected area now should be obtained using Area.get_selection_bounds(), and not using Area.orig_x, Area.orig_y and the selection size. This properties should be removed after finish refactoring. The property Area.sel_get_out was removed. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
* First stage of port of Paint to cairoGonzalo Odiard2012-08-101-206/+156
| | | | | | | | | | | | | | | | | | | | | | | | | Brushes and shapes are working. NOTES: * The pixmaps used as canvas has been replaced by ImageSurface and cairo context. * All the gc with tool properties were removed. * The variables needed by the freeform and rainbow were moved from Area to Desenha * The freeform code was simplified. * The heart is draw using cairo curves and is a little different than before. * I am using cairo_stroke_color and cairo_fill_color values in the tool dict to enable compatibility while the port is done, later will be unified. I am setting this color with a fixed alpha of 0.3 to display artifacts if we want enable alpha in the future. It's only for test at this stage. * The code used to display the polygons (triangle, trapezoid, arrow, paralellogram, star, polygon_regular) was simplified calling a method _draw_polygon witha array of points. PENDING: * All the clipboard operations. * All the efects. * Text * Bucket * Stamps
* Undo after using bucket tool fixed SL #3105Manuel Kaufmann2012-06-071-1/+7
| | | | | | | | Fixed the ability to go back and forward through the undo list after using many times the bucket tool. Signed-off-by: Manuel Kaufmann <humitos@gmail.com> Acked-by: Manuel Quiñones <manuq@laptop.org>
* Target rectangle in Stamp at first usage SL #3602Manuel Kaufmann2012-05-291-0/+3
| | | | | | | Show the target rectangle inmediatly when the Stamp tool is selected and don't remove the sensitive of the Stamp tool button if it's being used. Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
* Avoid using numpy 1.6.1 in invert_colors functionManuel Kaufmann2012-05-041-1/+10
| | | | | | | | There is a bug (or something like that) in numpy 1.6.1 that makes invert_color to not work properly. So, now we are checking for this version and if it's found we use the string implementation of this funcion instead. Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
* Keep flood fill cursor after clicks SL #3491Manuel Kaufmann2012-04-301-2/+7
| | | | | | | | When the user selects the Paint Bucket tool and clicks on the canvas, the bucket cursor is kept until the user selects another tool. Signed-off-by: Manuel Kaufmann <humitos@gmail.com> Acked-by: Manuel Quinones <manuq@laptop.org>
* Add cursor for the picker tool #3496Manuel Quiñones2012-04-261-5/+13
| | | | Signed-off-by: Manuel Quiñones <manuq@laptop.org>
* Pep8 fixes in Area.pyGonzalo Odiard2012-04-181-2/+1
|