MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / ClipLeft

Function ClipLeft

src/gui/gui.c:2456–2460  ·  view source on GitHub ↗

* Applies left clipping to a line. * @param x1 Pointer to the X-coordinate of the begin of the line. * @param y1 Pointer to the Y-coordinate of the begin of the line. * @param x2 The X-coordinate of the end of the line. * @param y2 The Y-coordinate of the end of the line. */

Source from the content-addressed store, hash-verified

2454 * @param y2 The Y-coordinate of the end of the line.
2455 */
2456static void ClipLeft(int16 *x1, int16 *y1, int16 x2, int16 y2)
2457{
2458 *y1 += (y2 - *y1) * (g_clipping.left - *x1) / (x2 - *x1);
2459 *x1 = g_clipping.left;
2460}
2461
2462/**
2463 * Applies right clipping to a line.

Callers 1

GUI_DrawLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected