MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / SlopesEqual

Function SlopesEqual

TheForceEngine/TFE_Polygon/clipper.cpp:541–551  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539//----------------------------------------------------------------------
540
541bool SlopesEqual(const TEdge &e1, const TEdge &e2, bool UseFullInt64Range)
542{
543#ifndef use_int32
544 if (UseFullInt64Range)
545 return Int128Mul(e1.Top.Y - e1.Bot.Y, e2.Top.X - e2.Bot.X) ==
546 Int128Mul(e1.Top.X - e1.Bot.X, e2.Top.Y - e2.Bot.Y);
547 else
548#endif
549 return (e1.Top.Y - e1.Bot.Y) * (e2.Top.X - e2.Bot.X) ==
550 (e1.Top.X - e1.Bot.X) * (e2.Top.Y - e2.Bot.Y);
551}
552//------------------------------------------------------------------------------
553
554bool SlopesEqual(const IntPoint pt1, const IntPoint pt2,

Callers 7

AddPathMethod · 0.85
AddLocalMinPolyMethod · 0.85
ProcessHorizontalMethod · 0.85
FixupOutPolygonMethod · 0.85
JoinPointsMethod · 0.85

Calls 1

Int128MulFunction · 0.85

Tested by

no test coverage detected