Use span
instead of div
in the text layer
This improves copy/pasting text content since it reduces the amount of unnecessary newlines.
This commit is contained in:
parent
4e3d694451
commit
5f15dc2023
@ -55,7 +55,7 @@ var renderTextLayer = (function renderTextLayerClosure() {
|
|||||||
|
|
||||||
function appendText(task, geom, styles) {
|
function appendText(task, geom, styles) {
|
||||||
// Initialize all used properties to keep the caches monomorphic.
|
// Initialize all used properties to keep the caches monomorphic.
|
||||||
var textDiv = document.createElement('div');
|
var textDiv = document.createElement('span');
|
||||||
var textDivProperties = {
|
var textDivProperties = {
|
||||||
style: null,
|
style: null,
|
||||||
angle: 0,
|
angle: 0,
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
.textLayer > div {
|
.textLayer > span {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
-webkit-transform-origin: 0% 0%;
|
-webkit-transform-origin: 0% 0%;
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
line-height: 1.0;
|
line-height: 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.textLayer > div {
|
.textLayer > span {
|
||||||
color: transparent;
|
color: transparent;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
|
@ -77,12 +77,12 @@ select {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pdfPresentationMode:fullscreen .textLayer > div {
|
.pdfPresentationMode:fullscreen .textLayer > span {
|
||||||
cursor: none;
|
cursor: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pdfPresentationMode.pdfPresentationModeControls > *,
|
.pdfPresentationMode.pdfPresentationModeControls > *,
|
||||||
.pdfPresentationMode.pdfPresentationModeControls .textLayer > div {
|
.pdfPresentationMode.pdfPresentationModeControls .textLayer > span {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1518,19 +1518,19 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * {
|
|||||||
mix-blend-mode: screen;
|
mix-blend-mode: screen;
|
||||||
}
|
}
|
||||||
|
|
||||||
#viewer.textLayer-visible .textLayer > div {
|
#viewer.textLayer-visible .textLayer > span {
|
||||||
background-color: rgba(255, 255, 0, 0.1);
|
background-color: rgba(255, 255, 0, 0.1);
|
||||||
color: black;
|
color: black;
|
||||||
border: solid 1px rgba(255, 0, 0, 0.5);
|
border: solid 1px rgba(255, 0, 0, 0.5);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
#viewer.textLayer-hover .textLayer > div:hover {
|
#viewer.textLayer-hover .textLayer > span:hover {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
#viewer.textLayer-shadow .textLayer > div {
|
#viewer.textLayer-shadow .textLayer > span {
|
||||||
background-color: rgba(255,255,255, .6);
|
background-color: rgba(255,255,255, .6);
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user