MCPcopy Create free account
hub / github.com/MyGUI/mygui / _getPerpendicular

Method _getPerpendicular

MyGUIEngine/src/MyGUI_PolygonalSkin.cpp:504–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502 }
503
504 FloatPoint PolygonalSkin::_getPerpendicular(const FloatPoint& _point1, const FloatPoint& _point2) const
505 {
506 // dy, -dx
507 FloatPoint result(_point1.top - _point2.top, -(_point1.left - _point2.left));
508 // normalise
509 float length = len(result.top, result.left);
510 result.left /= length;
511 result.top /= length;
512 result.left *= mLineWidth / 2;
513 result.top *= mLineWidth / 2;
514 return result;
515 }
516
517 FloatPoint PolygonalSkin::_getMiddleLine(
518 const FloatPoint& _point1,

Callers

nothing calls this directly

Calls 1

lenFunction · 0.70

Tested by

no test coverage detected