Thu, 09 Sep 2004

Fading Memories

Hacking on selections

Good progress today... I discovered yesterday that I had about ten more holidays left than I thought the day before yesterday, so I took two days off to hack on Krita. (Pity I didn't know earlier, or I'd had been able to go to either aKademy or to the monastery in Hemelum -- both equally attractive propositions.)


Today I got the selection code factored out of the humongous KisView class. If there's one thing I dislike about Qt coding, it's the tendency to have a View or Window class that's unmanageable because all actions, signals & slots are tied together in that single place. KisSelectionManager takes care of everything associated with selecting, cutting and pasting, and one day I'm going to do the same for the other chunks of functionality in KisView, such as the layer handling. Small is beautiful. Small classes, small packages.

Apart from that internal refactoring which users won't see, I've gotten select all, deselect and invert selection to work properly, done the enabling/disabling of selection actions and added actions for all the cool things you know you want to do with selections, like growing, feathering and all that.

Now I just need to implement all those actions, fix the selection tools, make selection-aware iterators, fix blitting so only selected pixels are blitted and link the selection to its layer. And implement loading/saving of selections.

Krita selections, by the way, are not your old-fashioned marching ant selections, but closer to Gimp and Photoshop masks, except that I understand what they do. I feel that Krita's selection are pretty intuitive and easy to handle. And it's a win that I didn't have to figure out how to let ants march along the edges of a discontinuous selection represented by a bytemap.

/hacking/krita | permanent link | |


Your Comment


Name:
URL/Email: [http://... or mailto:you@wherever] (optional)
Title: (optional)
Comment:
Save my Name and URL/Email for next time
Captcha: To prevent comment spam, please retype the characters in this image:

Enter the text here: