Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions component_layout_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def Run( self ):
# so leading parens are removed
# TODO: One day this might be released, and that will break this. But
# I don't know when, so we'll just have to wait and see...
use_vector2 = pcbnew.GetBuildVersion().lstrip('(').startswith('6.99')
use_vector6 = pcbnew.GetBuildVersion().lstrip('(').startswith('6.99')
use_vector7 = pcbnew.GetBuildVersion().lstrip('(').startswith('7')

pcb = pcbnew.GetBoard()
# In some cases, I have seen KIPRJMOD not set correctly here.
Expand Down Expand Up @@ -154,7 +155,7 @@ def Run( self ):
y = props['location'][1]

## Latest needs a pcbnew.VECTOR2I, 6.0.1 needs wxPoint
if use_vector2:
if use_vector6 or use_vector7:
mod.SetPosition(pcbnew.VECTOR2I_MM(x0 + x, y0 + y))
else:
mod.SetPosition(pcbnew.wxPointMM(x0 + x, y0 + y))
Expand Down