mathoudebine / turing-smart-screen-python

Unofficial Python system monitor and library for small IPS USB-C displays like Turing Smart Screen or XuanFang
GNU General Public License v3.0
1.05k stars 174 forks source link

Text position anchors #398

Closed CaraesNaur closed 2 months ago

CaraesNaur commented 9 months ago

Is your feature request related to a problem? If so, please describe the problem.
All displayed text is positioned with the top left corner of its bounding box at the specified pixel coordinates.

Describe the feature / solution to your problem you'd like
The ability to specify various points on the text bounding box to place at the given coordinate.

X-axis reference points:

Y-axis reference points:

Essentially a subset of the CSS position property. Thus, any theme entry which includes X and Y would also declare POSITION, i.e.:

POSITION: CENTER MIDDLE # Defaults to TOP LEFT (current behavior)

This would allow for much more precise text placement. Redraws after changing position would leave behind even more artifacts than current behavior, however this should only affect theme development.

Describe alternatives you've considered / and or tested
None.

Screenshots / photos & mockups of the Turing screen
N/A

Environment:

Additional context

A diagram of the proposed positions:

turing_position_map

mathoudebine commented 2 months ago

Thanks for your feedback, it is now implemented with the merge of #487