diff options
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index dfca12b1d49..8f0f794585a 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -283,10 +283,10 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, fl float maxxi= maxx - 1.0f; float minyi= miny + 1.0f; float maxyi= maxy - 1.0f; - float facxi= 1.0f/(maxxi-minxi); /* for uv */ - float facyi= 1.0f/(maxyi-minyi); + float facxi= (maxxi!=minxi) ? 1.0f/(maxxi-minxi) : 0.0f; /* for uv, can divide by zero */ + float facyi= (maxyi!=minyi) ? 1.0f/(maxyi-minyi) : 0.0f; int a, tot= 0, minsize; - + minsize= MIN2(rect->xmax-rect->xmin, rect->ymax-rect->ymin); if(2.0f*rad > minsize) |