chenbo007 / svg-edit

Automatically exported from code.google.com/p/svg-edit
0 stars 0 forks source link

Allow Multi-Select Mode #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In Select mode, it should be possible to drag-select and select multiple
elements in the canvas.

1) Draw a 'rubber-band' box as user starts dragging in Select mode, keeping
track of the bounding box.

2) Upon mouseup in select mode, select all elements that overlap with the
selection bounding box and show a selected outline that encompasses all of
the selected elements.

3) If multiple elements are selected, the context panel only allows the
following tools (for now):  Delete

4) Internally, code will have to be refactored so that selected is now an
array of all elements selected.  When the selectedOutline is recalculated
it will have to iterate over all selected elements, expanding the area
until of selection.  When dragging the selected, must now iterate, etc.

This is a pretty large change, and it should probably be done earlier
rather than later in 2.2 so that multi-select mode is thoroughly integrated
before moving on to other big features (like group/ungroup, for instance).

Original issue reported on code.google.com by codedr...@gmail.com on 18 Jun 2009 at 5:05

GoogleCodeExporter commented 9 years ago
Amendment to requirement #4:  Each element selected should have its own 
selectedOutline.

Original comment by codedr...@gmail.com on 27 Jun 2009 at 3:49

GoogleCodeExporter commented 9 years ago
I've started on the very beginnings of this in r221.  The code is not being 
used yet
- goal is to get single-select mode using SelectManager and Selector class 
first.  In
theory this will allow multiple selectors on the canvas at one time which will 
be
used for later.

Original comment by codedr...@gmail.com on 29 Jun 2009 at 4:08

GoogleCodeExporter commented 9 years ago
The refactored code is now being used for single-select mode.  In addition, 
I've made
a rubber band box thing that you can click in the canvas and drag.  This 
appears to
be a bit buggy.

Anyway, at the moment, there still is no true multiselect mode yet - but it's 
getting
closer.

Original comment by codedr...@gmail.com on 30 Jun 2009 at 3:59

GoogleCodeExporter commented 9 years ago
I've now checked in code (r244) that allows you to drag multiple elements at 
once. 
This was a massive refactoring, so there are bound to be lots of little errors. 
 Once
the obvious ones are cleaned up, I will close this issue:

a) Cannot yet delete multiple elements

b) Changing stroke/fill properties when multiple elements are selected does not
affect all elements

c) Drag-selecting does not truly work right because I'm only using evt.target 
(need
to write a function that sweeps through all elements and finds any intersecting 
the
rubber band box while dragging)

d) Sometimes selectors do not show up on all the elements that are actually 
selected

Original comment by codedr...@gmail.com on 1 Jul 2009 at 7:58

GoogleCodeExporter commented 9 years ago
e) Undoing a mass change means undoing the action for each element selected 
(should
be one atomic change that can be undone)

r245 now fixes issue b): changing stroke/fill properties now affects all 
elements
that were selected

Original comment by codedr...@gmail.com on 1 Jul 2009 at 8:06

GoogleCodeExporter commented 9 years ago
r246 now fixes issue a): I added a multiselect tool panel that just has a Delete
button for now.  Clicking it deletes all selected elements.

Original comment by codedr...@gmail.com on 1 Jul 2009 at 8:23

GoogleCodeExporter commented 9 years ago
r248 now fixes issue e): there is a batch command that can be used for changes 
that
are applied to multiple elements at once

Original comment by codedr...@gmail.com on 1 Jul 2009 at 9:29

GoogleCodeExporter commented 9 years ago
Alright, r249 fixes issue d): elements of the same type in a multi-select can 
now get
their own selector box.

With this fix, I'm closing the issue - multiselect is now workable.  Issue c) 
will be
addressed by a subsequent check-in.

With this checkin, I've also put the trunk into 'Alpha' since it's 
feature-complete.

Original comment by codedr...@gmail.com on 1 Jul 2009 at 10:00