mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-10 12:44:53 +00:00
Fix errors detected with gcc.
This commit is contained in:
parent
9320dca214
commit
ea3570796a
@ -48,7 +48,7 @@ public:
|
|||||||
void bottom(const T& bottom) { m_bottom = bottom; }
|
void bottom(const T& bottom) { m_bottom = bottom; }
|
||||||
|
|
||||||
SizeT<T> getSize() const {
|
SizeT<T> getSize() const {
|
||||||
return Size(m_left + m_right, m_top + m_bottom);
|
return SizeT<T>(m_left + m_right, m_top + m_bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
const BorderT& operator+=(const BorderT& br) {
|
const BorderT& operator+=(const BorderT& br) {
|
||||||
|
@ -60,8 +60,8 @@ public:
|
|||||||
// See that point2 isn't included in the rectangle, it's like the
|
// See that point2 isn't included in the rectangle, it's like the
|
||||||
// point returned by getPoint2() member function.
|
// point returned by getPoint2() member function.
|
||||||
RectT(const PointT<T>& point1, const PointT<T>& point2) {
|
RectT(const PointT<T>& point1, const PointT<T>& point2) {
|
||||||
Point leftTop = point1;
|
PointT<T> leftTop = point1;
|
||||||
Point rightBottom = point2;
|
PointT<T> rightBottom = point2;
|
||||||
register T t;
|
register T t;
|
||||||
|
|
||||||
if (leftTop.x > rightBottom.x) {
|
if (leftTop.x > rightBottom.x) {
|
||||||
@ -216,21 +216,21 @@ public:
|
|||||||
else if (rc.isEmpty())
|
else if (rc.isEmpty())
|
||||||
return *this;
|
return *this;
|
||||||
else
|
else
|
||||||
return Rect(Point(x < rc.x ? x: rc.x,
|
return RectT(PointT<T>(x < rc.x ? x: rc.x,
|
||||||
y < rc.y ? y: rc.y),
|
y < rc.y ? y: rc.y),
|
||||||
Point(x+w > rc.x+rc.w ? x+w: rc.x+rc.w,
|
PointT<T>(x+w > rc.x+rc.w ? x+w: rc.x+rc.w,
|
||||||
y+h > rc.y+rc.h ? y+h: rc.y+rc.h));
|
y+h > rc.y+rc.h ? y+h: rc.y+rc.h));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the intersection rectangle between this and rc rectangles.
|
// Returns the intersection rectangle between this and rc rectangles.
|
||||||
RectT createIntersect(const RectT& rc) const {
|
RectT createIntersect(const RectT& rc) const {
|
||||||
if (intersects(rc))
|
if (intersects(rc))
|
||||||
return Rect(Point(x > rc.x ? x: rc.x,
|
return RectT(PointT<T>(x > rc.x ? x: rc.x,
|
||||||
y > rc.y ? y: rc.y),
|
y > rc.y ? y: rc.y),
|
||||||
Point(x+w < rc.x+rc.w ? x+w: rc.x+rc.w,
|
PointT<T>(x+w < rc.x+rc.w ? x+w: rc.x+rc.w,
|
||||||
y+h < rc.y+rc.h ? y+h: rc.y+rc.h));
|
y+h < rc.y+rc.h ? y+h: rc.y+rc.h));
|
||||||
else
|
else
|
||||||
return Rect();
|
return RectT();
|
||||||
}
|
}
|
||||||
|
|
||||||
const RectT& operator+=(const BorderT<T>& br) {
|
const RectT& operator+=(const BorderT<T>& br) {
|
||||||
@ -244,11 +244,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
RectT operator+(const BorderT<T>& br) const {
|
RectT operator+(const BorderT<T>& br) const {
|
||||||
return Rect(*this).enlarge(br);
|
return RectT(*this).enlarge(br);
|
||||||
}
|
}
|
||||||
|
|
||||||
RectT operator-(const BorderT<T>& br) const {
|
RectT operator-(const BorderT<T>& br) const {
|
||||||
return Rect(*this).shrink(br);
|
return RectT(*this).shrink(br);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const RectT& rc) const {
|
bool operator==(const RectT& rc) const {
|
||||||
|
@ -31,11 +31,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T2>
|
template<typename T2>
|
||||||
explicit SizeT(const SizeT<T2>& size) : x(static_cast<T>(size.x)),
|
explicit SizeT(const SizeT<T2>& size) : w(static_cast<T>(size.w)),
|
||||||
y(static_cast<T>(size.y)) {
|
h(static_cast<T>(size.h)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
explicit SizeT(const PointT<T>& point) : w(pt.x), h(pt.y) {
|
explicit SizeT(const PointT<T>& point) : w(point.x), h(point.y) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SizeT createUnion(const SizeT& sz) const {
|
SizeT createUnion(const SizeT& sz) const {
|
||||||
|
@ -153,7 +153,7 @@ protected:
|
|||||||
typename Traits::address_t m_addr;
|
typename Traits::address_t m_addr;
|
||||||
public:
|
public:
|
||||||
void startScan(Image* bmp, int x, int y) {
|
void startScan(Image* bmp, int x, int y) {
|
||||||
m_addr = ((Traits::address_t*)bmp->line)[y]+x;
|
m_addr = ((typename Traits::address_t*)bmp->line)[y]+x;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ bool MovingPixelsState::onMouseUp(Editor* editor, Message* msg)
|
|||||||
m_pixelsMovement->dropImageTemporarily();
|
m_pixelsMovement->dropImageTemporarily();
|
||||||
|
|
||||||
// Redraw the new pivot location.
|
// Redraw the new pivot location.
|
||||||
invalidate();
|
editor->invalidate();
|
||||||
|
|
||||||
editor->releaseMouse();
|
editor->releaseMouse();
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user