MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / normalize_radius

Method normalize_radius

dep/agg/src/agg_rounded_rect.cpp:79–96  ·  view source on GitHub ↗

--------------------------------------------------------------------

Source from the content-addressed store, hash-verified

77
78 //--------------------------------------------------------------------
79 void rounded_rect::normalize_radius()
80 {
81 double dx = std::fabs(m_y2 - m_y1);
82 double dy = std::fabs(m_x2 - m_x1);
83
84 double k = 1.0;
85 double t;
86 t = dx / (m_rx1 + m_rx2); if(t < k) k = t;
87 t = dx / (m_rx3 + m_rx4); if(t < k) k = t;
88 t = dy / (m_ry1 + m_ry2); if(t < k) k = t;
89 t = dy / (m_ry3 + m_ry4); if(t < k) k = t;
90
91 if(k < 1.0)
92 {
93 m_rx1 *= k; m_ry1 *= k; m_rx2 *= k; m_ry2 *= k;
94 m_rx3 *= k; m_ry3 *= k; m_rx4 *= k; m_ry4 *= k;
95 }
96 }
97
98 //--------------------------------------------------------------------
99 void rounded_rect::rewind(unsigned)

Callers 1

roundedRectMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected