|
KiCad PCB EDA Suite
|
Helper functions that mirror the logic from DRC_RE_BITMAP_OVERLAY_PANEL. More...
Functions | |
| double | ComputeScaleFactor (double aRawScale) |
| Compute the scale factor from a raw content scale factor. | |
| wxPoint | ScalePosition (int aX, int aY, double aScaleFactor) |
| Scale a position from 1x bitmap coordinates to display coordinates. | |
| wxSize | ScaleSize (int aWidth, int aHeight, double aScaleFactor) |
| Scale a size from 1x bitmap coordinates to display coordinates. | |
| bool | IsOutOfBounds (const wxPoint &aScaledPos, const wxSize &aScaledSize, const wxSize &aBitmapSize) |
| Check if a field position exceeds bitmap bounds. | |
| void | SortByTabOrder (std::vector< DRC_RE_FIELD_POSITION > &aPositions) |
| Sort field positions by tab order. | |
Helper functions that mirror the logic from DRC_RE_BITMAP_OVERLAY_PANEL.
These allow testing the mathematical operations without requiring wxWidgets GUI.
| double BITMAP_OVERLAY_TEST_HELPERS::ComputeScaleFactor | ( | double | aRawScale | ) |
Compute the scale factor from a raw content scale factor.
Mirrors GetScaleFactor() logic from DRC_RE_BITMAP_OVERLAY_PANEL.
Definition at line 44 of file test_drc_bitmap_overlay_panel.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
| bool BITMAP_OVERLAY_TEST_HELPERS::IsOutOfBounds | ( | const wxPoint & | aScaledPos, |
| const wxSize & | aScaledSize, | ||
| const wxSize & | aBitmapSize ) |
Check if a field position exceeds bitmap bounds.
Mirrors bounds check logic from PositionFields() in DRC_RE_BITMAP_OVERLAY_PANEL.
Definition at line 79 of file test_drc_bitmap_overlay_panel.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
| wxPoint BITMAP_OVERLAY_TEST_HELPERS::ScalePosition | ( | int | aX, |
| int | aY, | ||
| double | aScaleFactor ) |
Scale a position from 1x bitmap coordinates to display coordinates.
Mirrors ScalePosition() logic from DRC_RE_BITMAP_OVERLAY_PANEL.
Definition at line 59 of file test_drc_bitmap_overlay_panel.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
| wxSize BITMAP_OVERLAY_TEST_HELPERS::ScaleSize | ( | int | aWidth, |
| int | aHeight, | ||
| double | aScaleFactor ) |
Scale a size from 1x bitmap coordinates to display coordinates.
Mirrors ScaleSize() logic from DRC_RE_BITMAP_OVERLAY_PANEL.
Definition at line 69 of file test_drc_bitmap_overlay_panel.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
| void BITMAP_OVERLAY_TEST_HELPERS::SortByTabOrder | ( | std::vector< DRC_RE_FIELD_POSITION > & | aPositions | ) |
Sort field positions by tab order.
Mirrors expected keyboard navigation order.
Definition at line 90 of file test_drc_bitmap_overlay_panel.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().