Help. Tricky code and lack of sleep have slowed my brain a bit too much.
For doing color drag-n-drop I've got an SPItem pointer, and the color RGB value that was that was dropped onto it.
My main question is what is the 'proper' way to do that?
The absolutely proper way is to act on selection/subselection^{1}, not on SPItem, and use sp_desktop_set_color for that, which will take care of everything. But if you absolutely must apply color to an item regardless of selection, then you'll have to construct a cssattr with that color in fill or stroke (see how sp_desktop_set_color does that) and then call the low-level function sp_desktop_apply_css_recursive on the item.
[1] The subselection is some part or aspect of a selected object, further selected by some specific tool. Two types of subselection currently supported are text selection (a text span selected by text tool) and gradient handle selection (one of gradient handles selected by gradient tool). If there's a subselection active, any style-setting commands will apply to that subselection instead of the entire selection.
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org
On Mar 9, 2006, at 4:49 PM, bulia byak wrote:
The absolutely proper way is to act on selection/subselection^{1}, not on SPItem, and use sp_desktop_set_color for that, which will take care of everything. But if you absolutely must apply color to an item regardless of selection, then you'll have to construct a cssattr with that color in fill or stroke (see how sp_desktop_set_color does that) and then call the low-level function sp_desktop_apply_css_recursive on the item.
Nope.
I tried that, but it had no visible effect.
:-(
The other point I'll address separately
On Mar 9, 2006, at 4:49 PM, bulia byak wrote:
[1] The subselection is some part or aspect of a selected object, further selected by some specific tool. Two types of subselection currently supported are text selection (a text span selected by text tool) and gradient handle selection (one of gradient handles selected by gradient tool). If there's a subselection active, any style-setting commands will apply to that subselection instead of the entire selection.
I've got the basic functionality going, but I've not yet change things to be smart about selections. I'll try to refine that over the next few days, but that subselection info will help a lot with testing things and getting them working nicer.
On 3/10/06, Jon A. Cruz <jon@...18...> wrote:
I've got the basic functionality going, but I've not yet change things to be smart about selections. I'll try to refine that over the next few days, but that subselection info will help a lot with testing things and getting them working nicer.
I'm not really sure if it makes sense to use selections for this or not. Maybe it is more intuitive indeen to drop the color on any object regardless of its being selected. I don't use drag and drop normally, so I have no real preference. Maybe other users could share their insights?
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org
On Mar 11, 2006, at 12:01 PM, bulia byak wrote:
On 3/10/06, Jon A. Cruz <jon@...18...> wrote:
I've got the basic functionality going, but I've not yet change things to be smart about selections. I'll try to refine that over the next few days, but that subselection info will help a lot with testing things and getting them working nicer.
I'm not really sure if it makes sense to use selections for this or not. Maybe it is more intuitive indeen to drop the color on any object regardless of its being selected. I don't use drag and drop normally, so I have no real preference. Maybe other users could share their insights?
That's probably what we need the most.
I can see a few situations where "playing nice" with selections would be handy. So feedback from people who actually use drag-n-drop would be good.
Additionally, feedback from those who *don't* use it is also helpful. It's important to see if it gets in the way at all.
I'm also wondering if hooking into the enter/leave detection used for cursor changes when in selection mode might be helpful. Perhaps we could tune it to show droppable/not-droppable as it moves.
On 3/11/06, Jon A. Cruz <jon@...18...> wrote:
I can see a few situations where "playing nice" with selections would be handy. So feedback from people who actually use drag-n-drop would be good.
FWIW, I just tried the current implementation which drops color on any object regardless of selection, and I think I rather like it. Feels quite natural.
Jon, _please_ fill in the Release Notes items for all your changes.
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org
On Mar 13, 2006, at 5:46 PM, bulia byak wrote:
On 3/11/06, Jon A. Cruz <jon@...18...> wrote:
I can see a few situations where "playing nice" with selections would be handy. So feedback from people who actually use drag-n-drop would be good.
FWIW, I just tried the current implementation which drops color on any object regardless of selection, and I think I rather like it. Feels quite natural.
Good.
I want to defer to those actually doing more art with Inkscape, so that's *very* good feedback. I'd gotten to the point where I wasn't sure which direction to take things, so that usually means time to smoke test with the heavy artists.
Jon, _please_ fill in the Release Notes items for all your changes.
D'oh! Paperwork.
I'll be sure to get it in this week, but it might take a tiny what with travel and all. However, if it seems to at least be in the ballpark, then there's really not any reason for me to hold off.
participants (3)
-
unknown@example.com
-
bulia byak
-
Jon A. Cruz