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

Function ClipRight

src/gui/gui.c:2469–2473  ·  view source on GitHub ↗

* Applies right 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

2467 * @param y2 The Y-coordinate of the end of the line.
2468 */
2469static void ClipRight(int16 *x1, int16 *y1, int16 x2, int16 y2)
2470{
2471 *y1 += (y2 - *y1) * (*x1 - g_clipping.right) / (*x1 - x2);
2472 *x1 = g_clipping.right;
2473}
2474
2475/**
2476 * Draws a line from (x1, y1) to (x2, y2) using given colour.

Callers 1

GUI_DrawLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected