mirror of
https://github.com/lalbornoz/roar.git
synced 2024-11-22 23:36:36 +00:00
liboperators/OperatorFlipVertical.py:{flipPairs,apply()}: correctly flip flippable text characters.
assets/text/TODO: updated.
This commit is contained in:
parent
a295d2c524
commit
9de2f906ba
@ -24,9 +24,8 @@ Queue:
|
|||||||
2) text tool: impl. backspace & enter, update internal brushPos if updated w/ arrow keys
|
2) text tool: impl. backspace & enter, update internal brushPos if updated w/ arrow keys
|
||||||
3) text tool: a) honour RTL text flow b) navigating w/ cursor keys c) pasting text
|
3) text tool: a) honour RTL text flow b) navigating w/ cursor keys c) pasting text
|
||||||
4) scroll down, apply operator to entire canvas, scroll up
|
4) scroll down, apply operator to entire canvas, scroll up
|
||||||
5) flip tool: correctly flip chars e.g. \ -> /, etc.
|
5) underline FUCKING BROKEN _AGAIN_
|
||||||
6) underline FUCKING BROKEN _AGAIN_
|
6) select-related {re,un}do bugs
|
||||||
7) select-related {re,un}do bugs
|
7) clone selection lag
|
||||||
8) clone selection lag
|
|
||||||
|
|
||||||
vim:ff=dos tw=0
|
vim:ff=dos tw=0
|
||||||
|
@ -8,12 +8,23 @@ from Operator import Operator
|
|||||||
|
|
||||||
class OperatorFlipVertical(Operator):
|
class OperatorFlipVertical(Operator):
|
||||||
name = "Flip"
|
name = "Flip"
|
||||||
|
flipPairs = {
|
||||||
|
"(":")", ")":"(",
|
||||||
|
"/":"\\", "\\":"/",
|
||||||
|
"\[":"]", "]":"\[",
|
||||||
|
"\{":"\}", "\}":"\{",
|
||||||
|
"<":">", ">":"<",
|
||||||
|
"`":"'",
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# apply(self, region)
|
# apply(self, region)
|
||||||
def apply(self, region):
|
def apply(self, region):
|
||||||
for numRow in range(len(region)):
|
for numRow in range(len(region)):
|
||||||
region[numRow].reverse()
|
region[numRow].reverse()
|
||||||
|
for numCol in range(len(region[numRow])):
|
||||||
|
if region[numRow][numCol][3] in self.flipPairs:
|
||||||
|
region[numRow][numCol][3] = self.flipPairs[region[numRow][numCol][3]]
|
||||||
return region
|
return region
|
||||||
|
|
||||||
# __init__(self, *args): initialisation method
|
# __init__(self, *args): initialisation method
|
||||||
|
Loading…
Reference in New Issue
Block a user