loleaflet/src/control/Control.LokDialog.js |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 640ce42b4fc9e62ddc2c79ca2a50e0678dddb836
Author:     Michael Meeks <michael.me...@collabora.com>
AuthorDate: Mon Jan 6 17:36:42 2020 +0000
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Mon Jan 6 17:36:42 2020 +0000

    dialogs: render red transparent rectangles to show dialog invalidation.
    
    Change-Id: Icff4a792dd54f9ab1c1f9abf13b8bdd869593fe2

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index d4040aadc..6f9b1dfd3 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -194,6 +194,19 @@ L.Control.LokDialog = L.Control.extend({
                this._sendPaintWindow(id, this._createRectStr(id, x, y, width, 
height));
        },
 
+       _debugPaintWindow: function(id, rectangle) {
+               var strId = this._toStrId(id);
+               var canvas = document.getElementById(strId + '-canvas');
+               if (!canvas)
+                       return; // no window to paint to
+               var ctx = canvas.getContext('2d');
+               ctx.beginPath();
+               var rect = rectangle.split(',');
+               ctx.rect(rect[0], rect[1], rect[2], rect[3]);
+               ctx.fillStyle = 'rgba(255, 0, 0, 0.5)';
+               ctx.fill();
+       },
+
        _sendPaintWindow: function(id, rectangle) {
                if (!rectangle)
                        return; // Don't request rendering an empty area.
@@ -205,6 +218,9 @@ L.Control.LokDialog = L.Control.extend({
                var dpiscale = L.getDpiScaleFactor();
                //console.log('_sendPaintWindow: rectangle: ' + rectangle + ', 
dpiscale: ' + dpiscale);
                this._map._socket.sendMessage('paintwindow ' + id + ' 
rectangle=' + rectangle + ' dpiscale=' + dpiscale);
+
+               if (this._map._docLayer && this._map._docLayer._debug)
+                       this._debugPaintWindow(id, rectangle);
        },
 
        _sendCloseWindow: function(id) {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to