Commit 89f158bb by PLN (Algolia)

midiviz: the wordmark spans D1-D3 — one cell made it a chip, three is the banner

parent 4ae02979
...@@ -1858,22 +1858,23 @@ def build_widget(port_label: str, reader: "Reader | None", scale: float = 1.0, ...@@ -1858,22 +1858,23 @@ def build_widget(port_label: str, reader: "Reader | None", scale: float = 1.0,
for y in range(img.height())) for y in range(img.height()))
def _paint_word(self, p): def _paint_word(self, p):
"""PARVAGUES inside the D1 cell, with the cell's own margin — """PARVAGUES over D1-D3 at the cells' own margin — the span is
PLN, 2026-09-24: "appears stuck to left wall, should fit in d1 three columns' inner rectangle (PLN: "should fit in d1-d3 not
cell so have same margin as cell". The span is the cell's inner just d1 its gtoo tiny atm" — one cell made the type a chip; three
rectangle, not three columns.""" is the banner)."""
span_w, span_h = max(20.0, self.cw - self.inset), max(8.0, self.ch - self.inset) span_w = max(20.0, 3 * self.cw - self.inset)
span_h = max(8.0, self.ch - self.inset)
pm = self._word_pixmap(span_w, span_h) pm = self._word_pixmap(span_w, span_h)
if pm is None: if pm is None:
return return
row_y = self.my + 3 * self.ch # PHYSICAL_ORDER index of D row_y = self.my + 3 * self.ch # PHYSICAL_ORDER index of D
p.setOpacity(WORD_ALPHA) p.setOpacity(WORD_ALPHA)
try: try:
# clamped to the cell's outer rect: at the smallest windows # clamped to the span's outer rect: at the smallest windows
# the glow ring can reach 1px past the inner margin, and a # the glow ring can reach 1px past the inner margin, and a
# 1px lean beats 1px of overlap # 1px lean beats 1px of overlap
p.drawPixmap(max(round(self.mx), p.drawPixmap(max(round(self.mx),
round(self.mx + (self.cw - pm.width()) / 2.0)), round(self.mx + (span_w - pm.width()) / 2.0)),
round(row_y + (self.ch - pm.height()) / 2.0), pm) round(row_y + (self.ch - pm.height()) / 2.0), pm)
finally: finally:
p.setOpacity(1.0) p.setOpacity(1.0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment