aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2011-11-09 21:45:42 +0100
committerThomas White <taw@bitwiz.org.uk>2011-11-09 21:45:42 +0100
commitc63628b7a4a3bcd103cc7a29857fe89225ed2897 (patch)
treee522e7f79a6a09e0a08d0cb5445ccd634dfd55ad /src
parent204b75d648a24d9a03f53b60c6c77a128eedee37 (diff)
Fix image minimum size
Diffstat (limited to 'src')
-rw-r--r--src/tool_image.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/tool_image.c b/src/tool_image.c
index 1ea0d90..e41a285 100644
--- a/src/tool_image.c
+++ b/src/tool_image.c
@@ -241,9 +241,16 @@ static void calculate_box_size(struct object *o, double x, double y,
dbx = ti->box_width - o->bb_width;
dby = ti->box_height - o->bb_height;
- /* FIXME: This is wrong */
- if ( ti->box_width < 20.0 ) ti->box_width = 20.0;
- if ( ti->box_height < 20.0 ) ti->box_height = 20.0;
+ if ( ti->box_width < 40.0 ) {
+ mult = 40.0 / o->bb_width;
+ }
+ if ( ti->box_height < 40.0 ) {
+ mult = 40.0 / o->bb_height;
+ }
+ ti->box_width = o->bb_width * mult;
+ ti->box_height = o->bb_height * mult;
+ dbx = ti->box_width - o->bb_width;
+ dby = ti->box_height - o->bb_height;
switch ( ti->drag_corner ) {