Browse Source

Merge pull request #4595 from brendandahl/search-regression

Append whitespace divs so matches still line up.
Yury Delendik 11 years ago
parent
commit
c88696cf5f
  1. 2
      web/text_layer_builder.js

2
web/text_layer_builder.js

@ -112,6 +112,7 @@ var TextLayerBuilder = function textLayerBuilder(options) { @@ -112,6 +112,7 @@ var TextLayerBuilder = function textLayerBuilder(options) {
this.appendText = function textLayerBuilderAppendText(geom, styles) {
var style = styles[geom.fontName];
var textDiv = document.createElement('div');
this.textDivs.push(textDiv);
if (!/\S/.test(geom.str)) {
textDiv.dataset.isWhitespace = true;
return;
@ -140,7 +141,6 @@ var TextLayerBuilder = function textLayerBuilder(options) { @@ -140,7 +141,6 @@ var TextLayerBuilder = function textLayerBuilder(options) {
textDiv.dataset.canvasWidth = geom.width * this.viewport.scale;
}
this.textDivs.push(textDiv);
};
this.setTextContent = function textLayerBuilderSetTextContent(textContent) {

Loading…
Cancel
Save