pladams9/hexsheets

Cell text should not be a canvas "window" item

Closed this issue · 2 comments

Broken resize preview lines

broken line

This is happening because the cell text for each cell is a label in a window. Windows are drawn above everything on a canvas.

Cell text should be changed to use a text canvas item so that it works like other canvas items. A the same time, text items should only be created for cells that have text in them. This might speed things up some (both using less items and not using full label widgets).

Label widgets and windows were used originally to allow the label to easily be cut off to a specific square. A new way will need to be worked out... possibly just reducing the number of characters in each text item based on size.

Originally posted by @pladams9 in #42 (comment)

Current thought on correcting this: use Pillow to create an image for each cell's text, and display that as an image item on the canvas.

See: https://pillow.readthedocs.io/en/stable/index.html

Another question to be answered: how should cut off text be displayed?

  • With an ellipsis (...),
  • With an obscuring mark (Excel uses #####),
  • With a simple square cut that could land mid-letter, or
  • With a hexagonal cut, allowing the text to flow to the very edge of the cell?