On tool change, we used to simply halt tools before switching to the
new one, which meant losing ongoing live-previewed tool changes, like
transforms, warps and color corrections. This change makes them being
applied to the image instead before switching to the new tool:
Add enum value GIMP_TOOL_ACTION_COMMIT that is passed to
GimpTool::control() before tool switching. Handle the new enum value
in all tools, and actually commit the previewed stuff. This changes
the behavior of GimpCageTool, GimpImageMapTool, GimpTransformTool and
GimpWarpTool.
When a drawing timeout happens too close from the previous drawing, we don't want to cancel
the timeout function (FALSE), but simply retry later (TRUE).
In our case in particular, if you move your pointer very fast over a guide, the highlighting
drawing was happening less than MINIMUM_DRAW_INTERVAL before the un-highlighting drawing,
hence canceling the later, which caused the drawing bug.
Added complete API for zoom/unzoom (scale and scroll) and
rotate/unrotate, with the same set of functions as the existing
transform/untransform. Moved some special case functions to the
namespaces they belong.
Don't install the frame rate limiting draw timeout when resuming a
draw tool that is not active, so accidential timeout installation from
whatever tool dispose code can't happen.
Even less drawing: let the timeout running if it triggers within the
50ms since the last drawing, so it's reduced to its actual purpose of
updating to the actual cursor position after framerate-limiter skipped
drawing.
One more try: merge the spirit of Alexia's patch, but don't disable
the timeout, only make sure the minimum fps is also applied when
drawing is triggered by gimp_draw_tool_resume().
Add a canvas item group for previews, and a small preview infrastructure
to GimpDrawTool, and put the transform preview into the preview group,
which is below all guides, grid and layer boundaries.
which removes a lot of code from the transform tool, and reduces the
number of canvas items used for the transform grid from possibly
gazillions to one.
Removes a lot of code from the rectangle tool and fixes off-by-one
drawing problems because in image coordinates, lines can't be aligned
correctly with rectangles.
so wrong calls will run into precondition checks and warnings. This is
optional, but currently enabled, to reduce the risk of introducing
permanent new warnings for 2.8. See STRICT_TOOL_CHECKS in gimptool.h.
Add a transform matrix to GimpCanvasBoundary and get rid of the whole
BoundSeg transform code in boundary.c and gimpbrushcore.c, it was
impossible to get this right on that level. Also fix te extents of
GimpCanvasBoundary os it leaves no artifacts.
- add gimp_draw_tool_push_group()/pop_group() which manage a stack
of groups; all items automatically get added to the stack's top group
- use push_group()/pop_group() all over the place, which saves a lot
of code in most cases
- return GimpCanvasGroup not GimpCanvasItem pointers from
gimp_draw_tool_add_stroke_group() and fill_group()
Unrelated:
- add GipmCanvasGroup parameter to gimp_rectangle_tool_draw()
- put rect select's round corners into the stroke group to
avoid ugly overdrawing (the mis-alignment of arcs becomes
very visible now however, will fix that soon)
of the guide and sample point canvas items. They are too obscure to
additionally hide them, and these items are used rarely enough to
justify the additional parameter to the new() functions.
- Invalidate the proper area when an item gets added or removed.
- Draw the kept canvas items instead of calling a draw tool function.
- The draw tool now sets its item on the shell.