Fix: Grease Pencil: Use correct "aspect_ratio" in draw tool
The `aspect_ratio` was defaulting to 0 when drawing. Now use the correct brush setting values. This also ensures that the default is 1.
This commit is contained in:
@@ -276,6 +276,7 @@ struct PaintOperationExecutor {
|
||||
ColorGeometry4f vertex_color_ = ColorGeometry4f(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
ColorGeometry4f fill_color_ = ColorGeometry4f(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
float softness_;
|
||||
float aspect_ratio_;
|
||||
|
||||
bool use_vertex_color_;
|
||||
bool use_settings_random_;
|
||||
@@ -301,7 +302,7 @@ struct PaintOperationExecutor {
|
||||
}
|
||||
}
|
||||
softness_ = 1.0f - settings_->hardness;
|
||||
jitter_settings_ = BKE_brush_color_jitter_get_settings(scene_, paint, brush_);
|
||||
aspect_ratio_ = settings_->aspect_ratio[0] / math::max(settings_->aspect_ratio[1], 1e-8f);
|
||||
}
|
||||
|
||||
void process_start_sample(PaintOperation &self,
|
||||
@@ -424,6 +425,13 @@ struct PaintOperationExecutor {
|
||||
curve_attributes_to_skip.add("u_scale");
|
||||
u_scale.finish();
|
||||
}
|
||||
if (bke::SpanAttributeWriter<float> aspect_ratio =
|
||||
attributes.lookup_or_add_for_write_span<float>("aspect_ratio", bke::AttrDomain::Curve))
|
||||
{
|
||||
aspect_ratio.span[active_curve] = aspect_ratio_;
|
||||
curve_attributes_to_skip.add("aspect_ratio");
|
||||
aspect_ratio.finish();
|
||||
}
|
||||
|
||||
if (settings_->uv_random > 0.0f || attributes.contains("rotation")) {
|
||||
if (bke::SpanAttributeWriter<float> rotations =
|
||||
|
||||
Reference in New Issue
Block a user