From 3e37b9ec8e8b79d26760b3fd601f4f8291ec221a Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Tue, 24 Jan 2017 11:07:17 +0100 Subject: [PATCH] fix(cairo): Increment textblock bg extents --- include/cairo/context.hpp | 3 ++- src/components/renderer.cpp | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/cairo/context.hpp b/include/cairo/context.hpp index 02fe7a8a..591b4895 100644 --- a/include/cairo/context.hpp +++ b/include/cairo/context.hpp @@ -190,7 +190,8 @@ namespace cairo { { *this << t.bg; cairo_set_operator(m_c, static_cast(t.bg_operator)); - cairo_rectangle(m_c, t.bg_rect.x, t.bg_rect.y, t.bg_rect.w + extents.x_advance, t.bg_rect.h); + cairo_rectangle(m_c, t.bg_rect.x + *t.x_advance, t.bg_rect.y + *t.y_advance, + t.bg_rect.w + extents.x_advance, t.bg_rect.h); cairo_fill(m_c); } restore(true); diff --git a/src/components/renderer.cpp b/src/components/renderer.cpp index 45338b1c..0752fbdb 100644 --- a/src/components/renderer.cpp +++ b/src/components/renderer.cpp @@ -499,7 +499,6 @@ void renderer::draw_text(const string& contents) { if (m_bg && m_bg != m_bar.background) { block.bg = m_bg; block.bg_operator = static_cast(m_comp_bg); - block.bg_rect.x = m_rect.x + m_blocks[m_align].x; block.bg_rect.y = m_rect.y; block.bg_rect.h = m_rect.height; }