void View::addCenterLines( std::vector<RenderData> &data, const ci::ColorA &color, const ci::Rectf rect, float lineWidth ) { vec2 offset = rect.getUpperLeft(); float w = rect.getWidth(); float h = rect.getHeight(); float hw = w*0.5; float hh = h*0.5; addLine( data, color, offset + vec2(0, hh), offset + vec2(w, hh), lineWidth ); addLine( data, color, offset + vec2(hw, 0), offset + vec2(hw, h), lineWidth ); }
void View::addPointGrid( std::vector<RenderData> &data, const ci::ColorA &color, const ci::Rectf rect, float gridInterval, float pointSize ) { vec2 offset = rect.getUpperLeft(); float w = rect.getWidth(); float h = rect.getHeight(); float hw = w*0.5; float hh = h*0.5; for( int x = 0; x <= hw; x+=gridInterval ) { for( int y = 0; y <= hh; y+=gridInterval ) { addPoint( data, color, offset + vec2(hw+x, hh+y), pointSize ); addPoint( data, color, offset + vec2(hw-x, hh+y), pointSize ); addPoint( data, color, offset + vec2(hw-x, hh-y), pointSize ); addPoint( data, color, offset + vec2(hw+x, hh-y), pointSize ); } } }
void Control::setRect(const ci::Rectf &rect) { setSize(rect.getSize()); setLocation(rect.getUpperLeft()); }
ci::Rectf Control::screen(const ci::Rectf &rect) const { return rect + screen(rect.getUpperLeft()); }