Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: Source/core/rendering/shapes/ShapeInterval.h

Issue 212223006: [CSS Shapes] Simplify RasterShape implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix style errors Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/shapes/Shape.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/shapes/ShapeInterval.h
diff --git a/Source/core/rendering/shapes/ShapeInterval.h b/Source/core/rendering/shapes/ShapeInterval.h
index efeb7d862c0e046e20620aa3df10acb9b2634250..3c2fb368a72a1c4efcfdc50210ab0a2d94fa687c 100644
--- a/Source/core/rendering/shapes/ShapeInterval.h
+++ b/Source/core/rendering/shapes/ShapeInterval.h
@@ -207,6 +207,16 @@ public:
bool operator==(const ShapeInterval<T>& other) const { return x1() == other.x1() && x2() == other.x2(); }
bool operator!=(const ShapeInterval<T>& other) const { return !operator==(other); }
+ void unite(const ShapeInterval<T>& interval)
+ {
+ if (interval.isEmpty())
+ return;
+ if (isEmpty())
+ set(interval.x1(), interval.x2());
+ else
+ set(std::min<T>(x1(), interval.x1()), std::max<T>(x2(), interval.x2()));
+ }
+
private:
T m_x1;
T m_x2;
« no previous file with comments | « Source/core/rendering/shapes/Shape.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698