diff options
author | Thomas White <taw@bitwiz.me.uk> | 2019-03-24 23:33:44 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2019-03-24 23:33:44 +0100 |
commit | 86f73eac9bd24cde5be223b9973296d479a8deb7 (patch) | |
tree | 30b8e7f5697a08dfa62d2b5d7d5abb091f3e6190 /libstorycode/gtk/gtkslideview.c | |
parent | 95b3b770fe3d3acf20ff1d2a0c8ddf1fd9c2758c (diff) |
Handle upside-down text frame creation
Diffstat (limited to 'libstorycode/gtk/gtkslideview.c')
-rw-r--r-- | libstorycode/gtk/gtkslideview.c | 10 |
1 files changed, 10 insertions, 0 deletions
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; |