mirror of https://github.com/GNOME/gimp.git
fixed "aspect-ratio" bug, and a workaround for the palette dialog rezing
weirdness
This commit is contained in:
parent
24cb62a81c
commit
d1b0f22db8
|
@ -371,6 +371,8 @@ channel_preview (Channel *channel, int width, int height)
|
|||
{
|
||||
/* calculate 'acceptable' subsample */
|
||||
subsample = 1;
|
||||
if (width < 1) width = 1;
|
||||
if (height < 1) height = 1;
|
||||
while ((width * (subsample + 1) * 2 < channel->width) &&
|
||||
(height * (subsample + 1) * 2 < channel->height))
|
||||
subsample = subsample + 1;
|
||||
|
|
|
@ -371,6 +371,8 @@ channel_preview (Channel *channel, int width, int height)
|
|||
{
|
||||
/* calculate 'acceptable' subsample */
|
||||
subsample = 1;
|
||||
if (width < 1) width = 1;
|
||||
if (height < 1) height = 1;
|
||||
while ((width * (subsample + 1) * 2 < channel->width) &&
|
||||
(height * (subsample + 1) * 2 < channel->height))
|
||||
subsample = subsample + 1;
|
||||
|
|
|
@ -371,6 +371,8 @@ channel_preview (Channel *channel, int width, int height)
|
|||
{
|
||||
/* calculate 'acceptable' subsample */
|
||||
subsample = 1;
|
||||
if (width < 1) width = 1;
|
||||
if (height < 1) height = 1;
|
||||
while ((width * (subsample + 1) * 2 < channel->width) &&
|
||||
(height * (subsample + 1) * 2 < channel->height))
|
||||
subsample = subsample + 1;
|
||||
|
|
|
@ -971,8 +971,11 @@ layer_preview (layer, w, h)
|
|||
|
||||
/* calculate 'acceptable' subsample */
|
||||
subsample = 1;
|
||||
/* handle some truncation errors */
|
||||
if (w < 1) w = 1;
|
||||
if (h < 1) h = 1;
|
||||
while ((w * (subsample + 1) * 2 < layer->width) &&
|
||||
(h * (subsample + 1) * 2 < layer->height))
|
||||
(h * (subsample + 1) * 2 < layer->height))
|
||||
subsample = subsample + 1;
|
||||
|
||||
pixel_region_init (&srcPR, layer->tiles, 0, 0, layer->width, layer->height, FALSE);
|
||||
|
@ -1021,6 +1024,8 @@ layer_mask_preview (layer, w, h)
|
|||
{
|
||||
/* calculate 'acceptable' subsample */
|
||||
subsample = 1;
|
||||
if (w < 1) w = 1;
|
||||
if (h < 1) h = 1;
|
||||
while ((w * (subsample + 1) * 2 < layer->width) &&
|
||||
(h * (subsample + 1) * 2 < layer->height))
|
||||
subsample = subsample + 1;
|
||||
|
|
|
@ -371,6 +371,8 @@ channel_preview (Channel *channel, int width, int height)
|
|||
{
|
||||
/* calculate 'acceptable' subsample */
|
||||
subsample = 1;
|
||||
if (width < 1) width = 1;
|
||||
if (height < 1) height = 1;
|
||||
while ((width * (subsample + 1) * 2 < channel->width) &&
|
||||
(height * (subsample + 1) * 2 < channel->height))
|
||||
subsample = subsample + 1;
|
||||
|
|
|
@ -971,8 +971,11 @@ layer_preview (layer, w, h)
|
|||
|
||||
/* calculate 'acceptable' subsample */
|
||||
subsample = 1;
|
||||
/* handle some truncation errors */
|
||||
if (w < 1) w = 1;
|
||||
if (h < 1) h = 1;
|
||||
while ((w * (subsample + 1) * 2 < layer->width) &&
|
||||
(h * (subsample + 1) * 2 < layer->height))
|
||||
(h * (subsample + 1) * 2 < layer->height))
|
||||
subsample = subsample + 1;
|
||||
|
||||
pixel_region_init (&srcPR, layer->tiles, 0, 0, layer->width, layer->height, FALSE);
|
||||
|
@ -1021,6 +1024,8 @@ layer_mask_preview (layer, w, h)
|
|||
{
|
||||
/* calculate 'acceptable' subsample */
|
||||
subsample = 1;
|
||||
if (w < 1) w = 1;
|
||||
if (h < 1) h = 1;
|
||||
while ((w * (subsample + 1) * 2 < layer->width) &&
|
||||
(h * (subsample + 1) * 2 < layer->height))
|
||||
subsample = subsample + 1;
|
||||
|
|
|
@ -36,11 +36,11 @@
|
|||
#include "interface.h"
|
||||
#include "palette.h"
|
||||
|
||||
#define ENTRY_WIDTH 18
|
||||
#define ENTRY_HEIGHT 14
|
||||
#define ENTRY_WIDTH 14
|
||||
#define ENTRY_HEIGHT 10
|
||||
#define SPACING 1
|
||||
#define COLUMNS 12
|
||||
#define ROWS 8
|
||||
#define COLUMNS 16
|
||||
#define ROWS 16
|
||||
|
||||
#define PREVIEW_WIDTH ((ENTRY_WIDTH * COLUMNS) + (SPACING * (COLUMNS + 1)))
|
||||
#define PREVIEW_HEIGHT ((ENTRY_HEIGHT * ROWS) + (SPACING * (ROWS + 1)))
|
||||
|
@ -184,6 +184,7 @@ palette_create ()
|
|||
|
||||
/* The shell and main vbox */
|
||||
palette->shell = gtk_dialog_new ();
|
||||
gtk_window_set_policy (GTK_WINDOW (palette->shell), FALSE, FALSE, FALSE);
|
||||
gtk_window_set_title (GTK_WINDOW (palette->shell), "Color Palette");
|
||||
vbox = gtk_vbox_new (FALSE, 1);
|
||||
gtk_container_border_width (GTK_CONTAINER (vbox), 1);
|
||||
|
|
|
@ -971,8 +971,11 @@ layer_preview (layer, w, h)
|
|||
|
||||
/* calculate 'acceptable' subsample */
|
||||
subsample = 1;
|
||||
/* handle some truncation errors */
|
||||
if (w < 1) w = 1;
|
||||
if (h < 1) h = 1;
|
||||
while ((w * (subsample + 1) * 2 < layer->width) &&
|
||||
(h * (subsample + 1) * 2 < layer->height))
|
||||
(h * (subsample + 1) * 2 < layer->height))
|
||||
subsample = subsample + 1;
|
||||
|
||||
pixel_region_init (&srcPR, layer->tiles, 0, 0, layer->width, layer->height, FALSE);
|
||||
|
@ -1021,6 +1024,8 @@ layer_mask_preview (layer, w, h)
|
|||
{
|
||||
/* calculate 'acceptable' subsample */
|
||||
subsample = 1;
|
||||
if (w < 1) w = 1;
|
||||
if (h < 1) h = 1;
|
||||
while ((w * (subsample + 1) * 2 < layer->width) &&
|
||||
(h * (subsample + 1) * 2 < layer->height))
|
||||
subsample = subsample + 1;
|
||||
|
|
|
@ -36,11 +36,11 @@
|
|||
#include "interface.h"
|
||||
#include "palette.h"
|
||||
|
||||
#define ENTRY_WIDTH 18
|
||||
#define ENTRY_HEIGHT 14
|
||||
#define ENTRY_WIDTH 14
|
||||
#define ENTRY_HEIGHT 10
|
||||
#define SPACING 1
|
||||
#define COLUMNS 12
|
||||
#define ROWS 8
|
||||
#define COLUMNS 16
|
||||
#define ROWS 16
|
||||
|
||||
#define PREVIEW_WIDTH ((ENTRY_WIDTH * COLUMNS) + (SPACING * (COLUMNS + 1)))
|
||||
#define PREVIEW_HEIGHT ((ENTRY_HEIGHT * ROWS) + (SPACING * (ROWS + 1)))
|
||||
|
@ -184,6 +184,7 @@ palette_create ()
|
|||
|
||||
/* The shell and main vbox */
|
||||
palette->shell = gtk_dialog_new ();
|
||||
gtk_window_set_policy (GTK_WINDOW (palette->shell), FALSE, FALSE, FALSE);
|
||||
gtk_window_set_title (GTK_WINDOW (palette->shell), "Color Palette");
|
||||
vbox = gtk_vbox_new (FALSE, 1);
|
||||
gtk_container_border_width (GTK_CONTAINER (vbox), 1);
|
||||
|
|
|
@ -36,11 +36,11 @@
|
|||
#include "interface.h"
|
||||
#include "palette.h"
|
||||
|
||||
#define ENTRY_WIDTH 18
|
||||
#define ENTRY_HEIGHT 14
|
||||
#define ENTRY_WIDTH 14
|
||||
#define ENTRY_HEIGHT 10
|
||||
#define SPACING 1
|
||||
#define COLUMNS 12
|
||||
#define ROWS 8
|
||||
#define COLUMNS 16
|
||||
#define ROWS 16
|
||||
|
||||
#define PREVIEW_WIDTH ((ENTRY_WIDTH * COLUMNS) + (SPACING * (COLUMNS + 1)))
|
||||
#define PREVIEW_HEIGHT ((ENTRY_HEIGHT * ROWS) + (SPACING * (ROWS + 1)))
|
||||
|
@ -184,6 +184,7 @@ palette_create ()
|
|||
|
||||
/* The shell and main vbox */
|
||||
palette->shell = gtk_dialog_new ();
|
||||
gtk_window_set_policy (GTK_WINDOW (palette->shell), FALSE, FALSE, FALSE);
|
||||
gtk_window_set_title (GTK_WINDOW (palette->shell), "Color Palette");
|
||||
vbox = gtk_vbox_new (FALSE, 1);
|
||||
gtk_container_border_width (GTK_CONTAINER (vbox), 1);
|
||||
|
|
Loading…
Reference in New Issue