From 606c02b842c3f3e1ea8f9ec4512a4f94de4da530 Mon Sep 17 00:00:00 2001 From: David Schnur Date: Tue, 2 Apr 2013 17:30:37 -0400 Subject: [PATCH] Tiny optimization; don't set info.y twice. --- jquery.flot.canvas.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery.flot.canvas.js b/jquery.flot.canvas.js index 171f463..8a9557a 100644 --- a/jquery.flot.canvas.js +++ b/jquery.flot.canvas.js @@ -314,15 +314,13 @@ browser, but needs to redraw with canvas text when exporting as an image. var info = this.getTextInfo(layer, text, font, angle); - info.x = x; - info.y = y; - // Mark the text for inclusion in the next render pass info.active = true; // Save horizontal alignment for later; we'll apply it per-line + info.x = x; info.halign = halign; // Tweak the initial y-position to match vertical alignment @@ -331,6 +329,8 @@ browser, but needs to redraw with canvas text when exporting as an image. info.y = y - info.height / 2; } else if (valign == "bottom") { info.y = y - info.height; + } else { + info.y = y; } }; }