Fix for division by zero error in Gradient2.cs
parent
ae01ccead4
commit
4ac901e416
|
@ -125,7 +125,7 @@ namespace UnityEngine.UI.Extensions
|
||||||
GetPosition = v => v.position.y;
|
GetPosition = v => v.position.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
float width = 1f / w / Zoom;
|
float width = w == 0f ? 0f : 1f / w / Zoom;
|
||||||
float zoomOffset = (1 - (1 / Zoom)) * 0.5f;
|
float zoomOffset = (1 - (1 / Zoom)) * 0.5f;
|
||||||
float offset = (Offset * (1 - zoomOffset)) - zoomOffset;
|
float offset = (Offset * (1 - zoomOffset)) - zoomOffset;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue