MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / offsetToXY

Function offsetToXY

plugins/Cardinal/src/EmbedWidget.cpp:32–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30#include "EmbedWidget.hpp"
31
32static void offsetToXY(const Vec offset, int& x, int& y)
33{
34 if (offset.x > 0.0f)
35 x = static_cast<int>(offset.x + 0.5f);
36 else if (offset.x < 0.0f)
37 x = static_cast<int>(offset.x - 0.5f);
38 else
39 x = 0;
40
41 if (offset.y > 0.0f)
42 y = static_cast<int>(offset.y + 0.5f);
43 else if (offset.y < 0.0f)
44 y = static_cast<int>(offset.y - 0.5f);
45 else
46 y = 0;
47}
48
49struct EmbedWidget::PrivateData {
50 #ifdef HAVE_X11

Callers 2

embedIntoRackMethod · 0.85
stepMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected