app: Aspect ratio fixes

This commit is contained in:
Alexia Death 2010-05-10 00:11:55 +03:00
parent 0cb1ada818
commit 4816a61dcb
2 changed files with 13 additions and 2 deletions

View File

@ -316,7 +316,7 @@ gimp_brush_generated_transform_size (GimpBrush *gbrush,
brush->radius * scale,
brush->spikes,
brush->hardness,
brush->aspect_ratio * aspect_ratio,
MIN (brush->aspect_ratio * aspect_ratio, 20),
(brush->angle + 360 * angle),
&half_width, &half_height,
NULL, NULL, NULL, NULL);
@ -335,7 +335,7 @@ gimp_brush_generated_transform_mask (GimpBrush *gbrush,
GimpBrushGenerated *brush = GIMP_BRUSH_GENERATED (gbrush);
/* Since generated brushes are symmetric the dont have intput
* for aspect ratios < 1.0. its same as rotate by 90 degrees and
* for aspect ratios < 1.0. its same as rotate by extra 90 degrees and
* 1 / ratio. So we fix the input up for this case. */
if (aspect_ratio < 1.0)

View File

@ -32,6 +32,7 @@
#include "paint-funcs/paint-funcs.h"
#include "core/gimpbrush.h"
#include "core/gimpbrushgenerated.h"
#include "core/gimpdrawable.h"
#include "core/gimpdynamics.h"
#include "core/gimpdynamicsoutput.h"
@ -42,8 +43,11 @@
#include "gimpbrushcore.h"
#include "gimpbrushcore-kernels.h"
#include "gimppaintoptions.h"
#include "gimp-intl.h"
@ -1021,6 +1025,13 @@ gimp_brush_core_transform_bound_segs (GimpBrushCore *core,
angle = core->angle;
aspect_ratio = core->aspect_ratio;
/* Generated brushes have their aspect ratio appled before base angle */
if (aspect_ratio != 1.0 && GIMP_IS_BRUSH_GENERATED (core->main_brush))
{
gdouble base_angle = gimp_brush_generated_get_angle (
GIMP_BRUSH_GENERATED (core->main_brush));
angle = angle + base_angle / 360;
}
height = core->brush_bound_width;
width = core->brush_bound_height;