Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit f372355

Browse files
author
jonahwilliams
committed
max basis XYZ
1 parent 1ce6a7b commit f372355

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

impeller/entity/geometry/point_field_geometry.cc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,16 @@ GeometryResult PointFieldGeometry::GetPositionBuffer(
2222
if (radius_ < 0.0) {
2323
return {};
2424
}
25-
Matrix transform = entity.GetTransform();
26-
Scalar determinant = transform.GetDeterminant();
27-
if (determinant == 0) {
28-
return {};
29-
}
25+
const Matrix& transform = entity.GetTransform();
3026

31-
Scalar min_size = 0.5f / sqrt(std::abs(determinant));
27+
Scalar min_size = 0.5f / transform.GetMaxBasisLengthXY();
3228
Scalar radius = std::max(radius_, min_size);
3329

3430
HostBuffer& host_buffer = renderer.GetTransientsBuffer();
3531
VertexBufferBuilder<SolidFillVertexShader::PerVertexData> vtx_builder;
3632
if (round_) {
3733
// Get triangulation relative to {0, 0} so we can translate it to each
38-
// point in turn. Note: we intentionally used the original radius here
34+
// point in turn. The original radius is also specified in order to
3935
// to capture any scaling < 1.0.
4036
auto generator =
4137
renderer.GetTessellator()->FilledCircle(transform, {}, radius_, radius);

0 commit comments

Comments
 (0)