jiayouxjh / grafx2

Automatically exported from code.google.com/p/grafx2
0 stars 0 forks source link

Lossless brush transformations [was Keyboard shortcuts for resizing custom brush] #319

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Grafx2 has no shortcuts for instantly doubling the brush, halving it, etc.
For reference, Deluxe Paint had:
 h  - Halve brush size
 H  - Double brush size
 X  - Double brush size on X axis only
 Y  - Double on Y

Requested by DawnBringer.

(When such shortcuts are implemented, they can replace the hard-coded
shortcuts that only work during a brush resize operation.)

Original issue reported on code.google.com by yrizoud on 18 Feb 2010 at 5:18

GoogleCodeExporter commented 9 years ago
Done in r1528. The Deluxe Paint shortcuts were available, so I picked them as 
defaults.
Note that they don't take effect when you're not using the brush. This is to 
prevent the brush from becoming huge and eating all memory, when you use wrong 
shortcut in a mode where the brush is not visible.

I'm not sure about changing the hard-coded shortcuts that only work during a 
brush resize operation : There's a technical challenge because the input engine 
discards keyboard input during an operation.

Original comment by yrizoud on 8 Jul 2010 at 11:51

GoogleCodeExporter commented 9 years ago
Very nice to finally see this. :) One little nitpick though: in Amiga programs 
(at least Brilliance & PPaint) the original brush is "remembered" - so you can 
do half-sizing and then double-sizing without loosing any quality (i.e. scale 
back to the original brush).

Original comment by annas...@hotmail.com on 9 Jul 2010 at 2:09

GoogleCodeExporter commented 9 years ago
This needs a specific backup of the brush that lasts as long as the only 
changes on the brush are resizes : Any grab, rotation, distort, flip, 
outline/nibble, or recolorize will make the old backup unusable.

It gets a bit complicated when mixed with Issue 362, where I need another 
backup in different colors and different rules of updating.

Original comment by yrizoud on 9 Jul 2010 at 3:20

GoogleCodeExporter commented 9 years ago
Yes, I'd only expect the backup to work while doing resizes - any other change 
would finalize the resize and make the current brush the working one (whilst 
keeping it's original palette ofcoz).

Original comment by annas...@hotmail.com on 9 Jul 2010 at 4:35

GoogleCodeExporter commented 9 years ago

Original comment by pulkoma...@gmail.com on 9 Aug 2010 at 9:48

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The proper way to do it would be to keep :
 * The original brush, as grabbed initially
 * A transform matrix

This can work for rotations, scaling, flipping. Not sure about distort. The 
others alter the pixel data, so yes, they would 'freeze' the brush as 
pixel-data and reset the transform matrix.

http://en.wikipedia.org/wiki/Transformation_matrix

Original comment by pulkoma...@gmail.com on 22 Aug 2010 at 5:19

GoogleCodeExporter commented 9 years ago

Original comment by pulkoma...@gmail.com on 22 Aug 2010 at 7:05

GoogleCodeExporter commented 9 years ago
I don't know if it's mandatory to handle it at the same time, but for better 
recoloring, we should keep a copy of the brush in its original palette, and the 
original palette.

Original comment by yrizoud on 22 Aug 2010 at 9:58

GoogleCodeExporter commented 9 years ago

Original comment by pulkoma...@gmail.com on 15 Feb 2011 at 8:12

GoogleCodeExporter commented 9 years ago
Original issue is fixed. For lossless see #381.

Original comment by pulkoma...@gmail.com on 15 Feb 2011 at 8:36