void DynamicShape::curveTo(boost::int32_t cx, boost::int32_t cy, boost::int32_t ax, boost::int32_t ay, int swfVersion) { if (!_currpath) startNewPath(true); assert(_currpath); _currpath->drawCurveTo(cx, cy, ax, ay); SWFRect bounds = _shape.getBounds(); unsigned thickness = _currline ? _shape.lineStyles().back().getThickness() : 0; if (_currpath->size() == 1) { _currpath->expandBounds(bounds, thickness, swfVersion); } else { bounds.expand_to_circle(ax, ay, swfVersion < 8 ? thickness : thickness / 2.0); bounds.expand_to_circle(cx, cy, swfVersion < 8 ? thickness : thickness / 2.0); } _shape.setBounds(bounds); // Update current pen position _x = ax; _y = ay; // Mark as changed _changed = true; }
SWFRect MorphShape::getBounds() const { // TODO: optimize this more. SWFRect bounds = _shape.getBounds(); bounds.expand_to_rect(_def->shape2().getBounds()); return bounds; }
void Bitmap::add_invalidated_bounds(InvalidatedRanges& ranges, bool force) { if (!force && !invalidated()) return; ranges.add(m_old_invalidated_ranges); SWFRect bounds; bounds.expand_to_transformed_rect(getWorldMatrix(*this), getBounds()); ranges.add(bounds.getRange()); }
void SWFMatrix::transform(SWFRect& r) const { if (r.is_null()) return; const boost::int32_t x1 = r.get_x_min(); const boost::int32_t y1 = r.get_y_min(); const boost::int32_t x2 = r.get_x_max(); const boost::int32_t y2 = r.get_y_max(); point p0(x1, y1); point p1(x2, y1); point p2(x2, y2); point p3(x1, y2); transform(p0); transform(p1); transform(p2); transform(p3); r.set_to_point(p0.x, p0.y); r.expand_to_point(p1.x, p1.y); r.expand_to_point(p2.x, p2.y); r.expand_to_point(p3.x, p3.y); }
void Video::add_invalidated_bounds(InvalidatedRanges& ranges, bool force) { if (!force && !invalidated()) return; // no need to redraw ranges.add(m_old_invalidated_ranges); assert(m_def); SWFRect bounds; bounds.expand_to_transformed_rect(getWorldMatrix(*this), m_def->bounds()); ranges.add(bounds.getRange()); }
geometry::Range2d<int> Renderer_gles1::world_to_pixel(const SWFRect& wb) const { using namespace gnash::geometry; if ( wb.is_null() ) return Range2d<int>(nullRange); if ( wb.is_world() ) return Range2d<int>(worldRange); int xmin, ymin, xmax, ymax; world_to_pixel(xmin, ymin, wb.get_x_min(), wb.get_y_min()); world_to_pixel(xmax, ymax, wb.get_x_max(), wb.get_y_max()); return Range2d<int>(xmin, ymin, xmax, ymax); }