diff options
author | Thomas White <taw@bitwiz.org.uk> | 2011-09-16 12:27:42 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2011-09-16 12:27:42 +0200 |
commit | 33fa59c9fe625bede83f83d39d5eda2833ef76b4 (patch) | |
tree | 7f9d3eb728a3fe52cffb3b9e8ba37357ee60485a /src/mainwindow.c | |
parent | 72e43d4f8e8c7ac80851d4057a4dbdae90fcba68 (diff) |
Scale the image down if it's a silly size
Diffstat (limited to 'src/mainwindow.c')
-rw-r--r-- | src/mainwindow.c | 17 |
1 files changed, 17 insertions, 0 deletions
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; } |