Commit 4816a61d authored by Alexia Death's avatar Alexia Death
Browse files

app: Aspect ratio fixes

parent 0cb1ada8
......@@ -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)
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment