nurpax / petmate

PETSCII editor with Electron/React/Redux
MIT License
185 stars 14 forks source link

Scroll through chars in user definable character sets with the mouse wheel #71

Open Esshahn opened 6 years ago

Esshahn commented 6 years ago

How do we deal with characters that do not have a counterpart?

Example: Character "A"

Example: Character: "O"

While a pattern matching approach (saw the code, absolutely awesome) is super smart, it would not cover other situations that might be useful, too, e.g. the different horizontal lines:

screenshot 2018-08-04 um 11 16 46

How about this suggestion:

Or combine both ideas:

That way you deal with all characters and have "smart" sets.

nurpax commented 6 years ago

So I'm putting off the selection set thing but I'd like to have 'r' rotate the currently selected character, just like it does for a brush.

But when rotating, how should the character selection pane react? Should it re-select the current char to whatever was chosen by rotation? Or should it keep the current selection but rotate only the char so that the rotated character shows as rotated on top of the painting canvas? The latter is sort of easier to implement. But would this feel like a bug that the selection doesn't change?

ESC would reset rotation & flips to defaults. Ditto for choosing another char from the char selector.

There's a bit of redux plumbing to be done to implement this well. It's not enough to just look up the rotated char code and set the selected char, and then on the next 'r' hit look up the next rotated char code and set the selected char.. Because not all rotations/flips are defined, so there needs to be a separate redux value that keeps track of rotation angle + flips (like there is for brushes).

nurpax commented 6 years ago

The 'r' shortcut is done and it is done so that it feels awesome!

Putting off the rest of this bug to 0.5 or later. The UI part would need to be designed in more detail. Also it feels a bit complex so maybe implement once someone feels super strongly about the need for this.