Fix T53997: island_margin in bpy.ops.uv.smart_project seems to have no effect

Now island margin acts as a percentage instead of being the actual distance.
So the margin distance will always be the same regardless of the actual size of the geometry.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D4514
This commit is contained in:
Sebastian Parborg 2019-03-28 12:53:36 +01:00
parent 5a8dcdd24e
commit 0403a2f785
Notes: blender-bot 2023-02-14 11:21:43 +01:00
Referenced by issue #53997, [bug] island_margin in bpy.ops.uv.smart_project seems to have no effect
1 changed files with 4 additions and 4 deletions

View File

@ -583,10 +583,10 @@ def packIslands(islandList):
w, h = maxx - minx, maxy - miny
if USER_ISLAND_MARGIN:
minx -= USER_ISLAND_MARGIN # *w
miny -= USER_ISLAND_MARGIN # *h
maxx += USER_ISLAND_MARGIN # *w
maxy += USER_ISLAND_MARGIN # *h
minx -= USER_ISLAND_MARGIN * w/2
miny -= USER_ISLAND_MARGIN * h/2
maxx += USER_ISLAND_MARGIN * w/2
maxy += USER_ISLAND_MARGIN * h/2
# recalc width and height
w, h = maxx - minx, maxy - miny