Browse Source

Record this as a known issue and point to the bug

dev
Andy Meneely 11 years ago
parent
commit
188112d581
  1. 13
      lib/squib/graphics/text.rb

13
lib/squib/graphics/text.rb

@ -111,14 +111,11 @@ module Squib
iter = layout.iter iter = layout.iter
while iter.next_char! && iter.index < index; end while iter.next_char! && iter.index < index; end
letter_width = iter.char_extents.width - spacing # the width of our inserted space char letter_width = iter.char_extents.width - spacing # the width of our inserted space char
para_x = case layout.alignment case layout.alignment
when Pango::Layout::Alignment::CENTER when Pango::Layout::Alignment::CENTER,
(layout.width - iter.line_extents[0].width) / 2 Pango::Layout::Alignment::RIGHT
when Pango::Layout::Alignment::RIGHT Squib.logger.warn "Center- or right-aligned text do not always embed properly. This is a known issue with a workaround. See https://github.com/andymeneely/squib/issues/46"
layout.width - iter.line_extents[0].width end
else
0
end
x = Pango.pixels(rect.x + (letter_width / 2)) x = Pango.pixels(rect.x + (letter_width / 2))
y = Pango.pixels(rect.y) y = Pango.pixels(rect.y)
svg(rule[:file], rule[:id], x, y, rule[:width], rule[:height], svg(rule[:file], rule[:id], x, y, rule[:width], rule[:height],

Loading…
Cancel
Save