/* * Copyright 2012 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file.
*/ #ifndef SkPathOpBounds_DEFINED #define SkPathOpBounds_DEFINED
// SkPathOpsBounds, unlike SkRect, does not consider a line to be empty. struct SkPathOpsBounds : public SkRect { staticbool Intersects(const SkPathOpsBounds& a, const SkPathOpsBounds& b) { return AlmostLessOrEqualUlps(a.fLeft, b.fRight)
&& AlmostLessOrEqualUlps(b.fLeft, a.fRight)
&& AlmostLessOrEqualUlps(a.fTop, b.fBottom)
&& AlmostLessOrEqualUlps(b.fTop, a.fBottom);
}
// Note that add(), unlike SkRect::join() or SkRect::growToInclude() // does not treat the bounds of horizontal and vertical lines as // empty rectangles. void add(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom) { if (left < fLeft) fLeft = left; if (top < fTop) fTop = top; if (right > fRight) fRight = right; if (bottom > fBottom) fBottom = bottom;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.