Skip to content

Commit bbcbb93

Browse files
committed
Revert "fix(reader): revert layering contract to per-box z-index stacking (#245)"
This reverts commit 0d1d479.
1 parent 0d1d479 commit bbcbb93

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

src/lib/components/Reader/TextBoxes.svelte

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,6 @@
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;
613612
user-select: text;
614613
-webkit-user-select: text;
615614
-moz-user-select: text;
@@ -633,7 +632,6 @@
633632
background-color: rgb(255, 255, 255);
634633
font-weight: var(--bold);
635634
font-family: 'Noto Sans JP', sans-serif;
636-
z-index: 11;
637635
user-select: text;
638636
-webkit-user-select: text;
639637
-moz-user-select: text;
@@ -668,17 +666,29 @@
668666
white-space: nowrap;
669667
}
670668
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. */
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. */
675673
.textBox.perLine .ocr-line.positionedLine {
676674
position: absolute;
677675
line-height: 1;
678676
letter-spacing: 0;
679677
white-space: nowrap;
680678
}
681679
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+
682692
/* A quad that captured multiple print columns (base text + furigana):
683693
the text flows inside the full quad bbox at the block's reference size,
684694
wrapping into columns/rows instead of shrinking onto one line. */

0 commit comments

Comments
 (0)