patchSkencil - Patches: patch #3693, PolyBezier commands

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #3693: PolyBezier commands

Submitter:  Valentin Ungureanu <vung>
Submitted:  Sun 30 Jan 2005 04:03:22 PM UTC
   
 
Category:  0.7.x Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Sat 23 Apr 2005 11:56:51 PM UTC, comment #4: 

Thanks for the updated patches.  I've applied them now with a few changes.  The biggest is that I added a dummy MultiBezierHit method to the MockGC that always returns 1.  This is to avoid importing the gtk module.  I'd like to be able to run the test suite without having a working X connection.
The other changes are slight formatting changes like removing superfluous backslashes on some lines.

Oh, and one tip for the doc-strings: I'd prefer doc strings that start with a single summary line optionally followed by an empty line and a more detailed explanation.

Bernhard Herzog <bh>
Group administrator
Sun 17 Apr 2005 03:33:26 PM UTC, comment #3: 

The new patches are polybeziercommands3.diff and
polybeziercommands3_tests.diff, please ignore the others.

New changes, this time more substantial:
    * added tests
    * added proper menu item sensitivity to the bezier commands
     (e.g.  disable Smooth when the continuity is already
     smooth, and so on)

About the sensitivity:
When you want to change the sensitivity of a menu item in
response to something, that something must cause a message to
be issued on one of the channels that the associated commands
listens to. This triggers the check, in our case that would be
check_polybezier_method (the former can_call_polybezier_method)

So if the sensitivities are to be reevaluated when a node is
selected, the only channel available would be HANDLES, since
there seem to be no other messages issued on other channels
when, for example, a new node is selected.

As a result, all polybezier commands now listen to HANDLES
instead of TOOL and SELECTION.

For the various checks I think that the best answers would come
from PolyBezierEditor itself, so I started to add the required
methods (CanSetContinuity an so on) and tests for them. As a
side note, testing also revealed an error when deleting all
nodes because this ends up calling self.document.DeselectObject
which doesn't exists.

As for the tests: there are two kind of methods tested: those
that affect the geometry of the underlying object (e.g.
DeleteNodes) and the new methods that just check for the
availability of the commands.  I put the former in
test_doceditor as transaction tests (though tests for REDRAW
messages are missing for now) and for the others I created a
new file, test_editbezier.py.

Valentin Ungureanu <vung>
Tue 08 Feb 2005 04:42:53 PM UTC, comment #2: 

There is a change in can_call_polybezier_method().
This function checked if editor.tool is an EditToolInstance, but the TOOL message is issued before the editor sets the new tool.
So, instead of checking with the editor, now it checks what is the value of context.tool.

A little note: since this function is called when a message is issued maybe it would be nice to somehow make available to it the channel and the message. As it is now, in this particular case, the TOOL message has some useful information (the new tool name) that is kind of 'lost'.

As for preserving the selection information when doing undo/redo, I'm not sure I understand...
Are you referring to the fact that it's not using apply() as in texttool? (wild guess)

Valentin Ungureanu <vung>
Sun 06 Feb 2005 08:40:40 PM UTC, comment #1: 

Look good on the whole.  One thing I noticed however, is that the selection information is not preserved in the same way as in 0.6 when doing undo/redo.

Also, some testcase would be nice to have but I'd probably apply the patch without them.

Bernhard Herzog <bh>
Group administrator
Sun 30 Jan 2005 04:03:22 PM UTC, original submission:  

This is an attempt to reintroduce some commands dealing with curves; the
layout of the code is the same as in the texttool.

Changes:

  • Sketch/Editor/edittool.py: Added some PolyBezier commands

that existed in Skencil 0.6: cont_angle, cont_smooth,
cont_symmetrical, segments_to_lines, segments_to_curve,
select_all_nodes, delete_nodes, insert_nodes, close_nodes,
open_nodes.

(EditToolInstance.CallObjectEditorMethod): New method.
Used to call methods from PolyBezierEditor.

(can_call_polybezier_method): New
(call_polybezier_method): New
Helpers for the commands related to PolyBeziers.

  • Sketch/Editor/__init__.py: Added the commands to standard_menu

and standard_keystrokes.

Valentin Ungureanu <vung>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #8691:  polybeziercommands3.diff added by vung (17KiB - text/x-diff)
file #8689:  polybeziercommands3_tests.diff added by vung (32KiB - text/x-diff - Tests for PolyBezierEditor)
file #8388:  polybeziercommands2.diff added by vung (6KiB - text/x-diff)
file #8335:  polybeziercommands.diff added by vung (6KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 8 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-04-23 bh StatusNone Done
    Open/ClosedOpen Closed
2005-04-17 vung Attached File- Added polybeziercommands3.diff, #4469
2005-04-17 vung Carbon-CopyRemoved bh -
2005-04-17 vung Attached File- Added polybeziercommands3_tests.diff, #4468
2005-02-08 vung Attached File- Added polybeziercommands2.diff, #4163
    Carbon-Copy- Added bh
2005-01-30 vung Attached File- Added polybeziercommands.diff, #4111

Back to the top

Powered by Savane 3.13-4448.
Corresponding source code