From 86f73eac9bd24cde5be223b9973296d479a8deb7 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sun, 24 Mar 2019 23:33:44 +0100 Subject: Handle upside-down text frame creation --- libstorycode/gtk/gtkslideview.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libstorycode/gtk/gtkslideview.c b/libstorycode/gtk/gtkslideview.c index 8251d34..91bc1c7 100644 --- a/libstorycode/gtk/gtkslideview.c +++ b/libstorycode/gtk/gtkslideview.c @@ -832,6 +832,16 @@ static SlideItem *create_frame(GtkSlideView *e, double cx, double cy, text = strdup(""); if ( text == NULL ) return NULL; + if ( w < 0.0 ) { + cx += w; + w = -w; + } + + if ( h < 0.0 ) { + cy += h; + h = -h; + } + geom.x.len = cx; geom.x.unit = LENGTH_UNIT; geom.y.len = cy; geom.y.unit = LENGTH_UNIT; geom.w.len = w; geom.w.unit = LENGTH_UNIT; -- cgit v1.2.3