From 33fa59c9fe625bede83f83d39d5eda2833ef76b4 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 16 Sep 2011 12:27:42 +0200 Subject: Scale the image down if it's a silly size --- src/mainwindow.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/mainwindow.c') diff --git a/src/mainwindow.c b/src/mainwindow.c index b209731..2c9ca2d 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -906,6 +906,23 @@ static void dnd_receive(GtkWidget *widget, GdkDragContext *drag_context, p->drag_highlight = 1; } + /* Scale the image down if it's a silly size */ + if ( p->drag_width > p->slide_width ) { + int new_drag_width; + new_drag_width = p->slide_width/2; + p->drag_height = (new_drag_width*p->drag_height) + / p->drag_width; + p->drag_width = new_drag_width; + } + + if ( p->drag_height > p->slide_height ) { + int new_drag_height; + new_drag_height = p->slide_height/2; + p->drag_width = (new_drag_height*p->drag_width) + / p->drag_height; + p->drag_height = new_drag_height; + } + p->draw_drag_box = 1; } -- cgit v1.2.3