comparison src/gtkimhtml.c @ 8588:7f7679853f7b

[gaim-migrate @ 9339] There was a bug: HR tags made the horizontal scroll bar show up on conversation windows. This mostly fixes that by leaving a little gap on the right side. You can still make the scroll bar appear if you reduce the size of the window. But it's only sometimes. Eh. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 06 Apr 2004 01:00:22 +0000
parents 88988327a4e0
children 44d6285a87af
comparison
equal deleted inserted replaced
8587:699cc19a40d6 8588:7f7679853f7b
2218 if(image->width > width || image->height > height){ 2218 if(image->width > width || image->height > height){
2219 GdkPixbuf *new_image = NULL; 2219 GdkPixbuf *new_image = NULL;
2220 float factor; 2220 float factor;
2221 int new_width = image->width, new_height = image->height; 2221 int new_width = image->width, new_height = image->height;
2222 2222
2223 if(image->width > width){ 2223 if(image->width > (width - 2)){
2224 factor = (float)(width)/image->width; 2224 factor = (float)(width)/image->width;
2225 new_width = width; 2225 new_width = width;
2226 new_height = image->height * factor; 2226 new_height = image->height * factor;
2227 } 2227 }
2228 if(new_height > height){ 2228 if(new_height >= (height - 2)){
2229 factor = (float)(height)/new_height; 2229 factor = (float)(height)/new_height;
2230 new_height = height; 2230 new_height = height;
2231 new_width = new_width * factor; 2231 new_width = new_width * factor;
2232 } 2232 }
2233 2233
2412 return GTK_IMHTML_SCALABLE(hr); 2412 return GTK_IMHTML_SCALABLE(hr);
2413 } 2413 }
2414 2414
2415 void gtk_imhtml_hr_scale(GtkIMHtmlScalable *scale, int width, int height) 2415 void gtk_imhtml_hr_scale(GtkIMHtmlScalable *scale, int width, int height)
2416 { 2416 {
2417 gtk_widget_set_size_request(((GtkIMHtmlHr *)scale)->sep, width, 2); 2417 gtk_widget_set_size_request(((GtkIMHtmlHr *)scale)->sep, width - 2, 2);
2418 } 2418 }
2419 2419
2420 void gtk_imhtml_hr_add_to(GtkIMHtmlScalable *scale, GtkIMHtml *imhtml, GtkTextIter *iter) 2420 void gtk_imhtml_hr_add_to(GtkIMHtmlScalable *scale, GtkIMHtml *imhtml, GtkTextIter *iter)
2421 { 2421 {
2422 GtkIMHtmlHr *hr = (GtkIMHtmlHr *)scale; 2422 GtkIMHtmlHr *hr = (GtkIMHtmlHr *)scale;