diff --git a/src/app/cmd/clear_mask.cpp b/src/app/cmd/clear_mask.cpp index f5f5fdc7b..98e1746e1 100644 --- a/src/app/cmd/clear_mask.cpp +++ b/src/app/cmd/clear_mask.cpp @@ -46,7 +46,7 @@ ClearMask::ClearMask(Cel* cel) m_offsetY = mask->bounds().y - cel->y(); gfx::Rect bounds = - image->bounds().createIntersect( + image->bounds().createIntersection( gfx::Rect( m_offsetX, m_offsetY, mask->bounds().w, mask->bounds().h)); diff --git a/src/app/cmd/clear_rect.cpp b/src/app/cmd/clear_rect.cpp index 123d8e491..92f142b29 100644 --- a/src/app/cmd/clear_rect.cpp +++ b/src/app/cmd/clear_rect.cpp @@ -34,7 +34,7 @@ ClearRect::ClearRect(Cel* cel, const gfx::Rect& bounds) m_offsetY = bounds.y - cel->y(); gfx::Rect bounds2 = - image->bounds().createIntersect( + image->bounds().createIntersection( gfx::Rect( m_offsetX, m_offsetY, bounds.w, bounds.h)); diff --git a/src/app/commands/cmd_flip.cpp b/src/app/commands/cmd_flip.cpp index 685b496da..63ddb622e 100644 --- a/src/app/commands/cmd_flip.cpp +++ b/src/app/commands/cmd_flip.cpp @@ -107,7 +107,7 @@ void FlipCommand::onExecute(Context* context) // Intersect the full area of the image with the mask's // bounds, so we don't request to flip an area outside the // image's bounds. - bounds = bounds.createIntersect(gfx::Rect(mask->bounds()).offset(-x, -y)); + bounds = bounds.createIntersection(gfx::Rect(mask->bounds()).offset(-x, -y)); // If the mask isn't a rectangular area, we've to flip the mask too. if (mask->bitmap() && !mask->isRectangular()) { diff --git a/src/app/commands/filters/filter_manager_impl.cpp b/src/app/commands/filters/filter_manager_impl.cpp index d32b755da..13e120584 100644 --- a/src/app/commands/filters/filter_manager_impl.cpp +++ b/src/app/commands/filters/filter_manager_impl.cpp @@ -127,7 +127,7 @@ void FilterManagerImpl::beginForPreview() Sprite* sprite = m_site.sprite(); gfx::Rect vp = View::getView(editor)->getViewportBounds(); vp = editor->screenToEditor(vp); - vp = vp.createIntersect(sprite->bounds()); + vp = vp.createIntersection(sprite->bounds()); if (vp.isEmpty()) { m_preview_mask.reset(NULL); diff --git a/src/app/tools/point_shapes.h b/src/app/tools/point_shapes.h index 870bec90e..232d1ef93 100644 --- a/src/app/tools/point_shapes.h +++ b/src/app/tools/point_shapes.h @@ -101,7 +101,7 @@ private: offset.x, offset.y, loop->sprite()->width(), loop->sprite()->height()); - bounds = bounds.createIntersect(loop->getSrcImage()->bounds()); + bounds = bounds.createIntersection(loop->getSrcImage()->bounds()); // Limit the flood-fill to the current tile if the grid is visible. if (loop->getGridVisible()) { @@ -117,7 +117,7 @@ private: d = div(y-dy.rem, grid.h); y = dy.rem + d.quot*grid.h; - bounds = bounds.createIntersect(gfx::Rect(x, y, grid.w, grid.h)); + bounds = bounds.createIntersection(gfx::Rect(x, y, grid.w, grid.h)); } return bounds; diff --git a/src/app/ui/editor/editor.cpp b/src/app/ui/editor/editor.cpp index 362f4fd0b..238791c6b 100644 --- a/src/app/ui/editor/editor.cpp +++ b/src/app/ui/editor/editor.cpp @@ -368,7 +368,7 @@ void Editor::updateEditor() void Editor::drawOneSpriteUnclippedRect(ui::Graphics* g, const gfx::Rect& spriteRectToDraw, int dx, int dy) { // Clip from sprite and apply zoom - gfx::Rect rc = m_sprite->bounds().createIntersect(spriteRectToDraw); + gfx::Rect rc = m_sprite->bounds().createIntersection(spriteRectToDraw); rc = m_zoom.apply(rc); int dest_x = dx + m_offset_x + rc.x; @@ -566,7 +566,7 @@ void Editor::drawSpriteUnclippedRect(ui::Graphics* g, const gfx::Rect& _rc) { // Clipping gfx::Rect cliprc = editorToScreen(rc).offset(-getBounds().getOrigin()); - cliprc = cliprc.createIntersect(spriteRect); + cliprc = cliprc.createIntersection(spriteRect); if (!cliprc.isEmpty()) { IntersectClip clip(g, cliprc); @@ -1085,7 +1085,7 @@ Rect Editor::getVisibleSpriteBounds() Rect vp = view->getViewportBounds(); vp = screenToEditor(vp); - return vp.createIntersect(m_sprite->bounds()); + return vp.createIntersection(m_sprite->bounds()); } // Changes the scroll to see the given point as the center of the editor. diff --git a/src/app/ui/skin/skin_theme.cpp b/src/app/ui/skin/skin_theme.cpp index 4e8715b2c..c69bc881c 100644 --- a/src/app/ui/skin/skin_theme.cpp +++ b/src/app/ui/skin/skin_theme.cpp @@ -1795,7 +1795,7 @@ void SkinTheme::paintTooltip(PaintEvent& ev) // Draw arrow in sides she::Surface* arrow = NULL; gfx::Rect target(widget->target()); - target = target.createIntersect(gfx::Rect(0, 0, ui::display_w(), ui::display_h())); + target = target.createIntersection(gfx::Rect(0, 0, ui::display_w(), ui::display_h())); target.offset(-absRc.getOrigin()); switch (widget->getArrowAlign()) { @@ -1902,7 +1902,7 @@ void SkinTheme::drawTextString(Graphics* g, const char *t, gfx::Color fg_color, } // Text - Rect textWrap = textrc.createIntersect( + Rect textWrap = textrc.createIntersection( // TODO add ui::Widget::getPadding() property // Rect(widget->getClientBounds()).shrink(widget->getBorder())); widget->getClientBounds()).inflate(0, 1*guiscale()); diff --git a/src/doc/algorithm/resize_image.cpp b/src/doc/algorithm/resize_image.cpp index bd59664ae..77c30ddc5 100644 --- a/src/doc/algorithm/resize_image.cpp +++ b/src/doc/algorithm/resize_image.cpp @@ -157,7 +157,7 @@ void fixup_image_transparent_colors(Image* image) count = 0; r = g = b = 0; - gfx::Rect area = gfx::Rect(x-1, y-1, 3, 3).createIntersect(image->bounds()); + gfx::Rect area = gfx::Rect(x-1, y-1, 3, 3).createIntersection(image->bounds()); LockImageBits::iterator it2 = bits.begin_area(area); LockImageBits::iterator end2 = bits.end_area(area); @@ -197,7 +197,7 @@ void fixup_image_transparent_colors(Image* image) count = 0; k = 0; - gfx::Rect area = gfx::Rect(x-1, y-1, 3, 3).createIntersect(image->bounds()); + gfx::Rect area = gfx::Rect(x-1, y-1, 3, 3).createIntersection(image->bounds()); LockImageBits::iterator it2 = bits.begin_area(area); LockImageBits::iterator end2 = bits.end_area(area); diff --git a/src/doc/conversion_she.cpp b/src/doc/conversion_she.cpp index 6dd5e8968..9a11421bf 100644 --- a/src/doc/conversion_she.cpp +++ b/src/doc/conversion_she.cpp @@ -1,5 +1,5 @@ // Aseprite Document Library -// Copyright (c) 2001-2014 David Capello +// Copyright (c) 2001-2015 David Capello // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. @@ -55,7 +55,7 @@ uint32_t convert_color_to_surface(colo template<> uint32_t convert_color_to_surface(color_t c0, const Palette* palette, const she::SurfaceFormatData* fd) { color_t c = palette->getEntry(c0); - return + return ((rgba_getr(c) << fd->redShift ) & fd->redMask ) | ((rgba_getg(c) << fd->greenShift) & fd->greenMask) | ((rgba_getb(c) << fd->blueShift ) & fd->blueMask ) | @@ -65,7 +65,7 @@ uint32_t convert_color_to_surface(color_ template<> uint32_t convert_color_to_surface(color_t c0, const Palette* palette, const she::SurfaceFormatData* fd) { color_t c = palette->getEntry(c0); - return + return ((rgba_getr(c) << fd->redShift ) & fd->redMask ) | ((rgba_getg(c) << fd->greenShift) & fd->greenMask) | ((rgba_getb(c) << fd->blueShift ) & fd->blueMask ) | @@ -137,7 +137,7 @@ void convert_image_to_surface(const Image* image, const Palette* palette, she::Surface* surface, int src_x, int src_y, int dst_x, int dst_y, int w, int h) { gfx::Rect srcBounds(src_x, src_y, w, h); - srcBounds = srcBounds.createIntersect(image->bounds()); + srcBounds = srcBounds.createIntersection(image->bounds()); if (srcBounds.isEmpty()) return; @@ -147,7 +147,7 @@ void convert_image_to_surface(const Image* image, const Palette* palette, h = srcBounds.h; gfx::Rect dstBounds(dst_x, dst_y, w, h); - dstBounds = dstBounds.createIntersect(surface->getClipBounds()); + dstBounds = dstBounds.createIntersection(surface->getClipBounds()); if (dstBounds.isEmpty()) return; diff --git a/src/doc/mask.cpp b/src/doc/mask.cpp index c70897d51..673f497f5 100644 --- a/src/doc/mask.cpp +++ b/src/doc/mask.cpp @@ -163,7 +163,7 @@ void Mask::intersect(const gfx::Rect& bounds) if (!m_bitmap) return; - gfx::Rect newBounds = m_bounds.createIntersect(bounds); + gfx::Rect newBounds = m_bounds.createIntersection(bounds); Image* image = NULL; diff --git a/src/doc/primitives.cpp b/src/doc/primitives.cpp index c40fb9ab3..22db9dac4 100644 --- a/src/doc/primitives.cpp +++ b/src/doc/primitives.cpp @@ -222,7 +222,7 @@ void fill_rect(Image* image, const gfx::Rect& rc, color_t c) { ASSERT(image); - gfx::Rect clip = rc.createIntersect(image->bounds()); + gfx::Rect clip = rc.createIntersection(image->bounds()); if (!clip.isEmpty()) image->fillRect(clip.x, clip.y, clip.x+clip.w-1, clip.y+clip.h-1, c); diff --git a/src/gfx/rect.h b/src/gfx/rect.h index 4e9c99e30..1cea61108 100644 --- a/src/gfx/rect.h +++ b/src/gfx/rect.h @@ -233,7 +233,7 @@ public: } // Returns the intersection rectangle between this and rc rectangles. - RectT createIntersect(const RectT& rc) const { + RectT createIntersection(const RectT& rc) const { if (intersects(rc)) return RectT(PointT(x > rc.x ? x: rc.x, y > rc.y ? y: rc.y), @@ -258,7 +258,7 @@ public: } const RectT& operator&=(const RectT& rc) { - return *this = createIntersect(rc); + return *this = createIntersection(rc); } RectT operator+(const BorderT& br) const { @@ -274,7 +274,7 @@ public: } RectT operator&(const RectT& other) const { - return createIntersect(other); + return createIntersection(other); } bool operator==(const RectT& rc) const { diff --git a/src/gfx/size.h b/src/gfx/size.h index cb4a53c5c..fa1f40f80 100644 --- a/src/gfx/size.h +++ b/src/gfx/size.h @@ -1,5 +1,5 @@ // Aseprite Gfx Library -// Copyright (C) 2001-2013 David Capello +// Copyright (C) 2001-2013, 2015 David Capello // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. @@ -44,7 +44,7 @@ public: std::max(h, sz.h)); } - SizeT createIntersect(const SizeT& sz) const { + SizeT createIntersection(const SizeT& sz) const { return SizeT(std::min(w, sz.w), std::min(h, sz.h)); } diff --git a/src/render/render.cpp b/src/render/render.cpp index cd2fc36a8..12a6b14ac 100644 --- a/src/render/render.cpp +++ b/src/render/render.cpp @@ -591,7 +591,7 @@ void Render::renderBackground(Image* image, int u_start = u; for (y=y_start-tile_h; yheight()+tile_h; y+=tile_h) { for (x=x_start-tile_w; xwidth()+tile_w; x+=tile_w) { - gfx::Rect fillRc = dstBounds.createIntersect(gfx::Rect(x, y, tile_w, tile_h)); + gfx::Rect fillRc = dstBounds.createIntersection(gfx::Rect(x, y, tile_w, tile_h)); if (!fillRc.isEmpty()) fill_rect( image, fillRc.x, fillRc.y, fillRc.x+fillRc.w-1, fillRc.y+fillRc.h-1, @@ -763,7 +763,7 @@ void Render::renderCel( int cel_y = zoom.apply(cel->y()); gfx::Rect src_bounds = - area.srcBounds().createIntersect( + area.srcBounds().createIntersection( gfx::Rect( cel_x, cel_y, zoom.apply(cel_image->width()), diff --git a/src/ui/menu.cpp b/src/ui/menu.cpp index 787a8c2cf..feb8297c2 100644 --- a/src/ui/menu.cpp +++ b/src/ui/menu.cpp @@ -747,8 +747,8 @@ bool MenuItem::onProcessMessage(Message* msg) r1.y = r2.y = y = MID(0, y, ui::display_h()-pos.h); // Calculate both intersections - gfx::Rect s1 = r1.createIntersect(old_pos); - gfx::Rect s2 = r2.createIntersect(old_pos); + gfx::Rect s1 = r1.createIntersection(old_pos); + gfx::Rect s2 = r2.createIntersection(old_pos); if (s2.isEmpty()) x = x_right; // Use the right because there aren't intersection with it