Line inconsistent Dash space when changing thickness

Avatar
  • updated
  • Fixed

I'm facing the following bug:

I use a pool of line and modify them on runtime :

- Change thickness and enable dash or not.

After a line was thicker and not dashed, when calling the method to enable dash and reduce the thickness -> one dash per two are invisible.

Here the code:

public class ShapeParticipationScaleLine : MonoBehaviour, IParticipationScaleLine
{
public float StandardThickness = 0.01f;
public float BoldThickness = 0.03f;

[Header("Link to components")]
[SerializeField]
protected TMPro.TextMeshPro scaleText;

[SerializeField]
protected Shapes.Line line;

private float scaleValue = 0f;

public void SetBold()
{
line.Dashed = false;
line.Thickness = BoldThickness;
}

public void SetNormal()
{
line.Dashed = true;
line.Thickness = StandardThickness;
}

public void SetValue(float value)
{
scaleValue = value;

scaleText.text = scaleValue.ToString();
}
}

And workaround is to change the thickness before the Dashed bool:

public void SetNormal()
{
line.Thickness = StandardThickness;
line.Dashed = true;
}

Reporting a bug? please specify Unity version:
2019.4.1f1
Reporting a bug? please specify Shapes version:
3.0.0
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Pinned replies
Avatar
Freya Holmér creator
  • Answer
  • Fixed

this has now been fixed in 3.2.0

Avatar
Freya Holmér creator
  • Answer
  • Fixed

this has now been fixed in 3.2.0