Skip to content

Commit

Permalink
fix no text background stroke
Browse files Browse the repository at this point in the history
  • Loading branch information
bcamper committed Jul 4, 2020
1 parent 26bfc53 commit e0d3bde
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/styles/text/text_canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default class TextCanvas {

// Computes width and height of text based on current font style
// Includes word wrapping, returns size info for whole text block and individual lines
textSize(style, text, { transform, text_wrap, max_lines, stroke_width = 0, background_color, background_stroke_width, supersample}) {
textSize(style, text, { transform, text_wrap, max_lines, stroke_width = 0, background_color, background_stroke_width = 0, supersample}) {
// Check cache first
TextCanvas.cache.text[style] = TextCanvas.cache.text[style] || {};
if (TextCanvas.cache.text[style][text]) {
Expand Down Expand Up @@ -190,7 +190,7 @@ export default class TextCanvas {
// draw optional background box
if (text_settings.background_color || text_settings.background_stroke_color) {
const background_stroke_color = text_settings.background_stroke_color;
const background_stroke_width = text_settings.background_stroke_width * dpr;
const background_stroke_width = (text_settings.background_stroke_width || 0) * dpr;

this.context.save();

Expand Down

0 comments on commit e0d3bde

Please sign in to comment.