Skip to content

Commit 0d1d479

Browse files
Gnathonicclaude
andauthored
fix(reader): revert layering contract to per-box z-index stacking (#245)
Restores z-index:11 on the box and its panel and drops the positionedLine z-index lift from f6b2aef. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent d869f6a commit 0d1d479

1 file changed

Lines changed: 6 additions & 16 deletions

File tree

src/lib/components/Reader/TextBoxes.svelte

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@
609609
font-family: 'Noto Sans JP', sans-serif;
610610
/* Word wrapping controlled dynamically by JavaScript */
611611
border: 1px solid rgba(0, 0, 0, 0);
612+
z-index: 11;
612613
user-select: text;
613614
-webkit-user-select: text;
614615
-moz-user-select: text;
@@ -632,6 +633,7 @@
632633
background-color: rgb(255, 255, 255);
633634
font-weight: var(--bold);
634635
font-family: 'Noto Sans JP', sans-serif;
636+
z-index: 11;
635637
user-select: text;
636638
-webkit-user-select: text;
637639
-moz-user-select: text;
@@ -666,29 +668,17 @@
666668
white-space: nowrap;
667669
}
668670
669-
/* Per-line mode: each line is placed at its detected quad with a
670-
geometry-derived font size. line-height 1 keeps the column/row no
671-
thicker than the font size; letter-spacing 0 because the print's
672-
tracking is already baked into the quad length the size was fitted to. */
671+
/* Original mode with lines_coords: each line is placed at its detected quad
672+
with a geometry-derived font size. line-height 1 keeps the column/row no
673+
thicker than the font size; letter-spacing 0 because the print's tracking
674+
is already baked into the quad length the size was fitted to. */
673675
.textBox.perLine .ocr-line.positionedLine {
674676
position: absolute;
675677
line-height: 1;
676678
letter-spacing: 0;
677679
white-space: nowrap;
678680
}
679681
680-
/* Layering contract for overlapping blocks (detector sometimes assigns a
681-
column to the neighboring block, so boxes overlap): every box's white
682-
panel must paint below every box's per-line text. The boxes stay
683-
z-index:auto (no own stacking context — tree order still stacks smaller
684-
boxes over bigger ones), while positioned line spans get a positive
685-
z-index that lifts them above all panels in the page's context. The
686-
whole-box panel is kept because it masks messy/angled print that
687-
per-line strips cannot cover. */
688-
.textBox.perLine .ocr-line.positionedLine {
689-
z-index: 1;
690-
}
691-
692682
/* A quad that captured multiple print columns (base text + furigana):
693683
the text flows inside the full quad bbox at the block's reference size,
694684
wrapping into columns/rows instead of shrinking onto one line. */

0 commit comments

Comments
 (0)