MCPcopy Create free account
hub / github.com/LibrePCB/LibrePCB / position_abs

Method position_abs

tests/ui/conftest.py:82–89  ·  view source on GitHub ↗

Convert a relative, normalized position to an absolute position For example (0, 0) to get the top left, (1, 1) to get the bottom right position of the UI element.

(self, rel_x, rel_y)

Source from the content-addressed store, hash-verified

80 self.size = size
81
82 def position_abs(self, rel_x, rel_y):
83 """
84 Convert a relative, normalized position to an absolute position
85
86 For example (0, 0) to get the top left, (1, 1) to get the bottom
87 right position of the UI element.
88 """
89 return (self.pos[0] + self.size[0] * rel_x, self.pos[1] + self.size[1] * rel_y)
90
91 @property
92 def center_abs(self):

Callers 2

center_absMethod · 0.95
test_close_first_sectionFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected