--- a/graphics/GraphicCommons.py Tue Aug 20 01:25:39 2024 +0200
+++ b/graphics/GraphicCommons.py Tue Aug 20 01:26:58 2024 +0200
@@ -349,10 +349,10 @@
posx, posy = self.GetPosition()
min_width, min_height = self.GetMinSize()
- self.Pos.x = max(0, self.Pos.x - (width - min_width) * x_factor)
+ self.Pos.x = max(0, round(self.Pos.x - (width - min_width) * x_factor)) - self.Pos.y = max(0, self.Pos.y - (height - min_height) * y_factor)
+ self.Pos.y = max(0, round(self.Pos.y - (height - min_height) * y_factor)) self.Pos.x = round_scaling(self.Pos.x, scaling[0])
@@ -1026,16 +1026,16 @@
- def __init__(self, parent, name, type, position, direction, negated=False, edge="none", onlyone=False):
+ def __init__(self, parent, name, Type, position, direction, negated=False, edge="none", onlyone=False): DebugDataConsumer.__init__(self)
ToolTipProducer.__init__(self, parent.Parent)
self.ParentBlock = parent
self.Direction = direction
- if self.ParentBlock.IsOfType("BOOL", type):
+ if self.ParentBlock.IsOfType("BOOL", Type): @@ -1141,8 +1141,8 @@
return self.ParentBlock.IsOfType(type, reference) or self.ParentBlock.IsOfType(reference, type)
# Changes the connector name
- def SetType(self, type):
+ def SetType(self, Type): for wire, _handle in self.Wires:
wire.SetValid(wire.IsConnectedCompatible())
--- a/graphics/LD_Objects.py Tue Aug 20 01:25:39 2024 +0200
+++ b/graphics/LD_Objects.py Tue Aug 20 01:26:58 2024 +0200
@@ -593,11 +593,11 @@
dc.SetBrush(wx.Brush(HIGHLIGHTCOLOR))
dc.SetLogicalFunction(wx.AND)
# Draw two rectangles for representing the contact
- left_left = (self.Pos.x - 1) * scalex - 2
- right_left = (self.Pos.x + self.Size[0] - 2) * scalex - 2
- top = (self.Pos.y - 1) * scaley - 2
- height = (self.Size[1] + 3) * scaley + 5
+ left_left = round((self.Pos.x - 1) * scalex) - 2 + right_left = round((self.Pos.x + self.Size[0] - 2) * scalex) - 2 + top = round((self.Pos.y - 1) * scaley) - 2 + width = round(4 * scalex + 5) + height = round((self.Size[1] + 3) * scaley) + 5 dc.DrawRectangle(left_left, top, width, height)
dc.DrawRectangle(right_left, top, width, height)