aboutsummaryrefslogtreecommitdiff
path: root/dw/fltkviewbase.cc
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2011-07-28 01:53:34 +0000
committercorvid <corvid@lavabit.com>2011-07-28 01:53:34 +0000
commitfba96a118b4c18076b5d2126524af477809b37b2 (patch)
treef8e26ed1d4550f38d270a1cbaf9fa765ff09d017 /dw/fltkviewbase.cc
parent088c9f87456944790625e772e3d7f1c406f8ed7c (diff)
wrap image alt text
Diffstat (limited to 'dw/fltkviewbase.cc')
-rw-r--r--dw/fltkviewbase.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/dw/fltkviewbase.cc b/dw/fltkviewbase.cc
index a01adf1a..ce8dc475 100644
--- a/dw/fltkviewbase.cc
+++ b/dw/fltkviewbase.cc
@@ -582,6 +582,24 @@ void FltkWidgetView::drawText (core::style::Font *font,
}
}
+/*
+ * "simple" in that it ignores letter-spacing, etc. This was added for image
+ * alt text where none of that matters.
+ */
+void FltkWidgetView::drawSimpleWrappedText (core::style::Font *font,
+ core::style::Color *color,
+ core::style::Color::Shading shading,
+ int X, int Y, int W, int H,
+ const char *text, int len)
+{
+ FltkFont *ff = (FltkFont*)font;
+ fl_font(ff->font, ff->size);
+ fl_color(((FltkColor*)color)->colors[shading]);
+ fl_draw(text,
+ translateCanvasXToViewX (X), translateCanvasYToViewY (Y),
+ W, H, FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_WRAP, NULL, 0);
+}
+
void FltkWidgetView::drawImage (core::Imgbuf *imgbuf, int xRoot, int yRoot,
int X, int Y, int width, int height)
{