loleaflet/css/leaflet.css | 8 ++++---- loleaflet/images/indentation_marker_down.svg | 16 +++++++++++++--- loleaflet/images/indentation_marker_up.svg | 16 +++++++++++++--- loleaflet/src/control/Ruler.js | 17 ++++++++--------- 4 files changed, 38 insertions(+), 19 deletions(-)
New commits: commit 5299ec381ce9e7df049bc16609f15af11d1c36b3 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Wed May 13 09:12:20 2020 +0200 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Wed May 13 10:05:11 2020 +0200 make indent markers nicer, put update after _TSContainer change Make markers look more like in LO - smaller, more slick. Move the _updateParagraphIndentations after _TSContainer position is recalculated as we depend on that. Change-Id: I08034f6b5402a1532b6f74203a465164327f4593 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94095 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/loleaflet/css/leaflet.css b/loleaflet/css/leaflet.css index ec6a3d3de..ccf881de2 100644 --- a/loleaflet/css/leaflet.css +++ b/loleaflet/css/leaflet.css @@ -843,8 +843,8 @@ input.clipboard { } .loleaflet-ruler-indentation-marker-down { - width: 17px; - height: 11px; + width: 14px; + height: 10px; background: url(images/indentation_marker_down.svg); position: absolute; left: 0; @@ -854,8 +854,8 @@ input.clipboard { } .loleaflet-ruler-indentation-marker-up { - width: 17px; - height: 11px; + width: 14px; + height: 10px; background: url(images/indentation_marker_up.svg); position: absolute; left: 0; diff --git a/loleaflet/images/indentation_marker_down.svg b/loleaflet/images/indentation_marker_down.svg index 41e73bbeb..9dd7fa373 100644 --- a/loleaflet/images/indentation_marker_down.svg +++ b/loleaflet/images/indentation_marker_down.svg @@ -1,3 +1,13 @@ -<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 140 110" > - <polygon points="10,10 130,10 130,50 70,100 10,50" /> -</svg> \ No newline at end of file +<?xml version="1.0" encoding="UTF-8"?> +<svg width="14" height="10" version="1.1" viewBox="0 0 14 10" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <metadata> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title/> + </cc:Work> + </rdf:RDF> + </metadata> + <polygon transform="matrix(.10796 0 0 .098871 -.55736 -.50999)" points="130 50 70 100 10 50 10 10 130 10" fill="#fff" stroke="#000" stroke-width="9.6788"/> +</svg> diff --git a/loleaflet/images/indentation_marker_up.svg b/loleaflet/images/indentation_marker_up.svg index 88f90c049..2bb0a9baf 100644 --- a/loleaflet/images/indentation_marker_up.svg +++ b/loleaflet/images/indentation_marker_up.svg @@ -1,3 +1,13 @@ -<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 140 110" > - <polygon points="10,100 130,100 130,60 70,10 10,60" /> -</svg> \ No newline at end of file +<?xml version="1.0" encoding="UTF-8"?> +<svg width="14" height="10" version="1.1" viewBox="0 0 14 10" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <metadata> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + <dc:title/> + </cc:Work> + </rdf:RDF> + </metadata> + <polygon transform="matrix(-.10796 0 0 -.098871 14.557 10.51)" points="130 10 130 50 70 100 10 50 10 10" fill="#fff" stroke="#000" stroke-width="9.6788"/> +</svg> diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js index 98b65370e..a5537055e 100644 --- a/loleaflet/src/control/Ruler.js +++ b/loleaflet/src/control/Ruler.js @@ -220,9 +220,9 @@ L.Control.Ruler = L.Control.extend({ // Conversion to mm100. if (this.options.indentUnit === 'inch') { - this.options.firstLineIndent = (this.options.firstLineIndent) * 2540; - this.options.leftParagraphIndent = (this.options.leftParagraphIndent) * 2540; - this.options.rightParagraphIndent = (this.options.rightParagraphIndent) * 2540; + this.options.firstLineIndent = this.options.firstLineIndent * 2540; + this.options.leftParagraphIndent = this.options.leftParagraphIndent * 2540; + this.options.rightParagraphIndent = this.options.rightParagraphIndent * 2540; } this.options.firstLineIndent *= pxPerMm100; @@ -235,10 +235,9 @@ L.Control.Ruler = L.Control.extend({ var pEndPosition = this._rTSContainer.getBoundingClientRect().right - this.options.rightParagraphIndent; // We calculated the positions. Now we should move them to left in order to make their sharp edge point to the right direction.. - var halfWidth = (this._firstLineMarker.getBoundingClientRect().right - this._firstLineMarker.getBoundingClientRect().left) * 0.5; - this._firstLineMarker.style.left = (fLinePosition - halfWidth) + 'px'; - this._pStartMarker.style.left = (pStartPosition - halfWidth) + 'px'; - this._pEndMarker.style.left = (pEndPosition - halfWidth) + 'px'; + this._firstLineMarker.style.left = (fLinePosition - (this._firstLineMarker.getBoundingClientRect().width / 2.0)) + 'px'; + this._pStartMarker.style.left = (pStartPosition - (this._pStartMarker.getBoundingClientRect().width / 2.0)) + 'px'; + this._pEndMarker.style.left = (pEndPosition - (this._pEndMarker.getBoundingClientRect().width / 2.0)) + 'px'; this._markerVerticalLine.style.top = this._rTSContainer.getBoundingClientRect().bottom + 'px'; }, @@ -263,8 +262,6 @@ L.Control.Ruler = L.Control.extend({ if (this.options.margin1 == null || this.options.margin2 == null) return; - this._updateParagraphIndentations(); - if (this._map._docLayer._annotations._items.length === 0 || this._map._docLayer._annotations._items.length === this._map._docLayer._annotations._hiddenItems @@ -388,6 +385,8 @@ L.Control.Ruler = L.Control.extend({ this._rTSContainer.style.left = (this.options.DraggableConvertRatio * lMargin) + 'px'; this._rTSContainer.style.right = (this.options.DraggableConvertRatio * rMargin) + 'px'; + this._updateParagraphIndentations(); + if (this.options.interactive) { this._changeInteractions({perm:'edit'}); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits