]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Fix clipping when zoomed (#6973)
authorJukka Kurkela <jukka.kurkela@gmail.com>
Sat, 18 Jan 2020 00:05:51 +0000 (02:05 +0200)
committerEvert Timberg <evert.timberg+github@gmail.com>
Sat, 18 Jan 2020 00:05:51 +0000 (19:05 -0500)
src/core/core.controller.js

index 81aaa9ceba116e5d8f53fa82f6dbd0ad43e35a39..4317bbfbd76d04b1cc2252490b6a1cc5b2c2b48b 100644 (file)
@@ -697,7 +697,6 @@ class Chart {
                const me = this;
                const ctx = me.ctx;
                const clip = meta._clip;
-               const canvas = me.canvas;
                const area = me.chartArea;
                const args = {
                        meta: meta,
@@ -710,9 +709,9 @@ class Chart {
 
                helpers.canvas.clipArea(ctx, {
                        left: clip.left === false ? 0 : area.left - clip.left,
-                       right: clip.right === false ? canvas.width : area.right + clip.right,
+                       right: clip.right === false ? me.width : area.right + clip.right,
                        top: clip.top === false ? 0 : area.top - clip.top,
-                       bottom: clip.bottom === false ? canvas.height : area.bottom + clip.bottom
+                       bottom: clip.bottom === false ? me.height : area.bottom + clip.bottom
                });
 
                meta.controller.draw();