mirror of https://github.com/GNOME/gimp.git
constrain popup size to GIMP_VIEWABLE_MAX_POPUP_SIZE but keep the aspect
2003-09-22 Sven Neumann <sven@gimp.org> * app/core/gimpviewable.c (gimp_viewable_get_popup_size): constrain popup size to GIMP_VIEWABLE_MAX_POPUP_SIZE but keep the aspect ratio intact. Fixes bug #122923. * app/text/gimpfont.c: use a smaller font size for popups so we don't exceed the maximum size.
This commit is contained in:
parent
7440dfd8fc
commit
8240ef1ccc
|
@ -1,3 +1,12 @@
|
|||
2003-09-22 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/core/gimpviewable.c (gimp_viewable_get_popup_size):
|
||||
constrain popup size to GIMP_VIEWABLE_MAX_POPUP_SIZE but keep the
|
||||
aspect ratio intact. Fixes bug #122923.
|
||||
|
||||
* app/text/gimpfont.c: use a smaller font size for popups so we
|
||||
don't exceed the maximum size.
|
||||
|
||||
2003-09-22 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* plug-ins/common/svg.c: added a hack to work around the
|
||||
|
|
|
@ -447,8 +447,25 @@ gimp_viewable_get_popup_size (GimpViewable *viewable,
|
|||
width, height, dot_for_dot,
|
||||
&w, &h))
|
||||
{
|
||||
w = MIN (w, GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
|
||||
h = MIN (h, GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
|
||||
if (w < 1) w = 1;
|
||||
if (h < 1) h = 1;
|
||||
|
||||
if (w > GIMP_VIEWABLE_MAX_POPUP_SIZE ||
|
||||
h > GIMP_VIEWABLE_MAX_POPUP_SIZE)
|
||||
{
|
||||
gdouble aspect = w / h;
|
||||
|
||||
if (w > h)
|
||||
{
|
||||
w = GIMP_VIEWABLE_MAX_POPUP_SIZE;
|
||||
h = w / aspect;
|
||||
}
|
||||
else
|
||||
{
|
||||
h = GIMP_VIEWABLE_MAX_POPUP_SIZE;
|
||||
w = h * aspect;
|
||||
}
|
||||
}
|
||||
|
||||
if (popup_width) *popup_width = w;
|
||||
if (popup_height) *popup_height = h;
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
contain all characters found in the alphabet. */
|
||||
#define GIMP_TEXT_PANGRAM N_("Pack my box with\nfive dozen liquor jugs.")
|
||||
|
||||
#define GIMP_FONT_POPUP_SIZE (PANGO_SCALE * 32)
|
||||
#define GIMP_FONT_POPUP_SIZE (PANGO_SCALE * 20)
|
||||
|
||||
|
||||
enum
|
||||
|
@ -247,8 +247,8 @@ gimp_font_get_popup_size (GimpViewable *viewable,
|
|||
pango_layout_set_text (font->popup_layout, gettext (GIMP_TEXT_PANGRAM), -1);
|
||||
pango_layout_get_pixel_extents (font->popup_layout, NULL, &logical);
|
||||
|
||||
*popup_width = MIN (logical.width + 6, GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
|
||||
*popup_height = MIN (logical.height + 6, GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
|
||||
*popup_width = MIN (logical.width + 6, GIMP_VIEWABLE_MAX_POPUP_SIZE);
|
||||
*popup_height = MIN (logical.height + 6, GIMP_VIEWABLE_MAX_POPUP_SIZE);
|
||||
|
||||
font->popup_width = *popup_width;
|
||||
font->popup_height = *popup_height;
|
||||
|
|
Loading…
Reference in New Issue