Fix dirty flag updating on {new,open,resize}.

assets/text/hotkeys.txt: updated.
assets/text/TODO: updated.
This commit is contained in:
Lucio Andrés Illanes Albornoz 2019-09-23 19:55:31 +02:00
parent bff70b409b
commit a48d7f3d32
5 changed files with 25 additions and 24 deletions

View File

@ -25,6 +25,6 @@ High-priority list:
a) new canvas/startup b) place rect c) move mouse d) undo status changes a) new canvas/startup b) place rect c) move mouse d) undo status changes
a) text tool b) paste text c) undo a) text tool b) paste text c) undo
2) add hotkeys.txt mIRC art canvas to help menu 2) add hotkeys.txt mIRC art canvas to help menu
2) tools: erase, pick, unicode block elements 3) tools: erase, pick, unicode block elements
vim:ff=dos tw=0 vim:ff=dos tw=0

View File

@ -1,6 +1,6 @@
<Ctrl> 0-9, <Ctrl> <Shift> 0-5, <Ctrl> <Shift> 6 Set foreground colour to #0-9, #10-15, transparent colour, resp. <Ctrl> 0-9, <Ctrl> <Shift> 0-5, <Ctrl> <Shift> 6 Set foreground colour to #0-9, #10-15, transparent colour, resp.
<Ctrl> <Alt> 0-9, <Ctrl> <Alt> <Shift> 0-5, <Ctrl> <Alt> <Shift> 6 Set background colour to #0-9, #10-15, transparent colour, resp. <Ctrl> <Alt> 0-9, <Ctrl> <Alt> <Shift> 0-5, <Ctrl> <Alt> <Shift> 6 Set background colour to #0-9, #10-15, transparent colour, resp.
<Ctrl> C U F L R E T Switch to circle, cursor, fill, line, rectangle, object, text tool <Ctrl> C, U, F, L, R, E, T Switch to circle, cursor, fill, line, rectangle, object, text tool
<Ctrl> I Flip colours <Ctrl> I Flip colours
<Ctrl> N New canvas <Ctrl> N New canvas
<Ctrl> O Open mIRC art file <Ctrl> O Open mIRC art file

View File

@ -27,8 +27,8 @@ class RoarCanvasCommandsFile():
try: try:
rc, error, newMap, newPathName, newSize = f(pathName) rc, error, newMap, newPathName, newSize = f(pathName)
if rc: if rc:
self.parentCanvas.update(newSize, False, newMap, dirty=newDirty)
self.parentCanvas.dirty = newDirty self.parentCanvas.dirty = newDirty
self.parentCanvas.update(newSize, False, newMap)
self.canvasPathName = newPathName self.canvasPathName = newPathName
self.update(dirty=self.parentCanvas.dirty, pathName=self.canvasPathName, undoLevel=-1) self.update(dirty=self.parentCanvas.dirty, pathName=self.canvasPathName, undoLevel=-1)
self.parentCanvas.canvas.journal.resetCursor() self.parentCanvas.canvas.journal.resetCursor()
@ -216,6 +216,7 @@ class RoarCanvasCommandsFile():
def canvasImportmIRC(pathName): def canvasImportmIRC(pathName):
rc, error = self.parentCanvas.canvas.importStore.importTextFile(pathName) rc, error = self.parentCanvas.canvas.importStore.importTextFile(pathName)
return (rc, error, self.parentCanvas.canvas.importStore.outMap, pathName, self.parentCanvas.canvas.importStore.inSize) return (rc, error, self.parentCanvas.canvas.importStore.outMap, pathName, self.parentCanvas.canvas.importStore.inSize)
if self._promptSaveChanges():
self._import(canvasImportmIRC, False, pathName) self._import(canvasImportmIRC, False, pathName)
@GuiCommandDecorator("Save", "&Save", ["", wx.ART_FILE_SAVE], [wx.ACCEL_CTRL, ord("S")], None) @GuiCommandDecorator("Save", "&Save", ["", wx.ART_FILE_SAVE], [wx.ACCEL_CTRL, ord("S")], None)

View File

@ -158,7 +158,7 @@ class RoarCanvasWindow(GuiWindow):
if self.canvas.dispatchPatchSingle(isCursor, patch, False if isCursor else True): if self.canvas.dispatchPatchSingle(isCursor, patch, False if isCursor else True):
self._drawPatch(eventDc, isCursor, patch) self._drawPatch(eventDc, isCursor, patch)
def resize(self, newSize, commitUndo=True): def resize(self, newSize, commitUndo=True, dirty=True):
viewRect = self.GetViewStart() viewRect = self.GetViewStart()
oldSize = [0, 0] if self.canvas.map == None else self.canvas.size oldSize = [0, 0] if self.canvas.map == None else self.canvas.size
deltaSize = [b - a for a, b in zip(oldSize, newSize)] deltaSize = [b - a for a, b in zip(oldSize, newSize)]
@ -176,11 +176,11 @@ class RoarCanvasWindow(GuiWindow):
for numNewCol in range(newSize[0]): for numNewCol in range(newSize[0]):
self._drawPatch(eventDc, False, [numNewCol, numNewRow, 1, 1, 0, " "]) self._drawPatch(eventDc, False, [numNewCol, numNewRow, 1, 1, 0, " "])
eventDc.SetDeviceOrigin(*eventDcOrigin) eventDc.SetDeviceOrigin(*eventDcOrigin)
self.Scroll(*viewRect) self.Scroll(*viewRect); self.dirty = dirty;
self.commands.update(size=newSize, undoLevel=self.canvas.journal.patchesUndoLevel) self.commands.update(dirty=self.dirty, size=newSize, undoLevel=self.canvas.journal.patchesUndoLevel)
def update(self, newSize, commitUndo=True, newCanvas=None): def update(self, newSize, commitUndo=True, newCanvas=None, dirty=True):
self.resize(newSize, commitUndo) self.resize(newSize, commitUndo, dirty)
self.canvas.update(newSize, newCanvas) self.canvas.update(newSize, newCanvas)
eventDc = self.backend.getDeviceContext(self.GetClientSize(), self, self.GetViewStart()) eventDc = self.backend.getDeviceContext(self.GetClientSize(), self, self.GetViewStart())
eventDcOrigin = eventDc.GetDeviceOrigin(); eventDc.SetDeviceOrigin(0, 0); eventDcOrigin = eventDc.GetDeviceOrigin(); eventDc.SetDeviceOrigin(0, 0);

View File

@ -27,7 +27,7 @@ def main(*argv):
roarClient.canvasPanel.commands.canvasPathName = argv[0] roarClient.canvasPanel.commands.canvasPathName = argv[0]
rc, error = roarClient.canvasPanel.canvas.importStore.importTextFile(argv[0]) rc, error = roarClient.canvasPanel.canvas.importStore.importTextFile(argv[0])
if rc: if rc:
roarClient.canvasPanel.update(roarClient.canvasPanel.canvas.importStore.inSize, False, roarClient.canvasPanel.canvas.importStore.outMap) roarClient.canvasPanel.update(roarClient.canvasPanel.canvas.importStore.inSize, False, roarClient.canvasPanel.canvas.importStore.outMap, dirty=False)
roarClient.canvasPanel.commands.update(pathName=argv[0], undoLevel=-1) roarClient.canvasPanel.commands.update(pathName=argv[0], undoLevel=-1)
roarClient.canvasPanel.commands._pushRecent(argv[0]) roarClient.canvasPanel.commands._pushRecent(argv[0])
else: else: