From 99e746f090d1cef5cf763f3456e038f0a4f31b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 12 Sep 2019 11:26:17 +0200 Subject: [PATCH] libgui/GuiCanvasWxBackend.py:_drawCharPatch(): fix underscore rendering. libgui/GuiCanvasWxBackend.py:_get{Brush,Char}PatchColours(): fix {back,fore}ground colour {brush{,es},pen}. assets/text/TODO: updated. --- assets/text/TODO | 15 +++++++++++---- libgui/GuiCanvasWxBackend.py | 14 +++++++++----- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/assets/text/TODO b/assets/text/TODO index 6845e94..2c275ab 100644 --- a/assets/text/TODO +++ b/assets/text/TODO @@ -5,12 +5,19 @@ 5) Arbitrary {format,palette}s ({4,8} bit ANSI/mIRC, etc.) 6) Hotkey & graphical interfaces to {composed,parametrised} tools 7) Incremental auto{load,save} & {backup,restore} (needs Settings window) -8) GUI: a) switch from wxPython to GTK b) {copy,cut,insert from,paste}, {de,in}crease cell size c) MRU {directories,files} -9) Layers, layout (e.g. for comics, zines, etc.) & asset management (e.g. kade, lion, etc.) & traits w/ {inserting,merging,linking} -10) Sprites & scripted (Python?) animation on the basis of asset traits and {composable,parametrised} patterns (metric flow, particle system, rigging, ...) -11) Composition and parametrisation of tools from higher-order operators (brushes, filters, outlines, patterns & shaders) and unit tools; unit tools: +8) Layers, layout (e.g. for comics, zines, etc.) & asset management (e.g. kade, lion, etc.) & traits w/ {inserting,merging,linking} +9) Sprites & scripted (Python?) animation on the basis of asset traits and {composable,parametrised} patterns (metric flow, particle system, rigging, ...) +10) Composition and parametrisation of tools from higher-order operators (brushes, filters, outlines, patterns & shaders) and unit tools; unit tools: a) geometric primitives (arrow, circle, cloud/speech bubble, curve, heart, hexagon, line, pentagon, polygon, rhombus, triangle, square, star) b) regions (crop, duplicate, erase, fill, invert, measure, pick, rotate, scale, select, shift, slice, tile, translate) c) text (edit, Unicode sets) +11) GUI: + a) {copy,cut,insert from,paste}, {de,in}crease cell size + b) replace logo w/ canvas panel in About dialogue + c) switch from wxPython to GTK + d) fix underscore rendering + e) MRU {directories,files} + f) ruler +12) fix outstanding {re,un}do bugs vim:ff=dos tw=0 diff --git a/libgui/GuiCanvasWxBackend.py b/libgui/GuiCanvasWxBackend.py index 7839ce8..61f99c9 100644 --- a/libgui/GuiCanvasWxBackend.py +++ b/libgui/GuiCanvasWxBackend.py @@ -44,9 +44,13 @@ class GuiCanvasWxBackend(): fontDc = wx.MemoryDC(); fontDc.SelectObject(fontBitmap); fontDc.SetTextForeground(wx.Colour(Colours[patch[0]][:4])) fontDc.SetTextBackground(wx.Colour(Colours[patch[1]][:4])) - fontDc.SetBrush(brushBg); fontDc.SetBackground(brushBg); fontDc.SetPen(pen); - fontDc.SetFont(self._font) - fontDc.DrawRectangle(0, 0, *self.cellSize); fontDc.DrawText(patch[3], 0, 0); + fontDc.SetBrush(brushBg); fontDc.SetPen(self._pens[patch[1]]); + fontDc.DrawRectangle(0, 0, *self.cellSize) + fontDc.SetBackground(brushBg); fontDc.SetPen(pen); fontDc.SetFont(self._font); + if patch[3] == "_": + fontDc.DrawLine(0, self.cellSize[1] - 1, self.cellSize[0], self.cellSize[1] - 1) + else: + fontDc.DrawText(patch[3], 0, 0) eventDc.Blit(*absPoint, *self.cellSize, fontDc, 0, 0) # }}} # {{{ _finiBrushesAndPens(self) @@ -58,7 +62,7 @@ class GuiCanvasWxBackend(): # {{{ _getBrushPatchColours(self, patch) def _getBrushPatchColours(self, patch): if (patch[0] != -1) and (patch[1] != -1): - brushBg, brushFg, pen = self._brushes[patch[0]], self._brushes[patch[1]], self._pens[patch[1]] + brushBg, brushFg, pen = self._brushes[patch[1]], self._brushes[patch[1]], self._pens[patch[1]] elif (patch[0] == -1) and (patch[1] == -1): brushBg, brushFg, pen = self._brushes[1], self._brushes[1], self._pens[1] elif patch[0] == -1: @@ -70,7 +74,7 @@ class GuiCanvasWxBackend(): # {{{ _getCharPatchColours(self, patch) def _getCharPatchColours(self, patch): if (patch[0] != -1) and (patch[1] != -1): - brushBg, brushFg, pen = self._brushes[patch[1]], self._brushes[patch[0]], self._pens[patch[1]] + brushBg, brushFg, pen = self._brushes[patch[1]], self._brushes[patch[0]], self._pens[patch[0]] elif (patch[0] == -1) and (patch[1] == -1): brushBg, brushFg, pen = self._brushes[1], self._brushes[1], self._pens[1] elif patch[0] == -1: