Title / Description
Code protected TDoubleRect GetBounds() { TLocalMinima lm = m_localMinimaList; if (lm == null) return new TDoubleRect(0, 0, 0, 0); TDoubleRect result = new TDoubleRect(-infinite, -infinite, infinite, infinite); while (lm != null) { if (lm.leftBound.y > result.bottom) result.bottom = lm.leftBound.y; TEdge e = lm.leftBound; while (e.nextInLML != null) { if (e.x < result.left) result.left = e.x; e = e.nextInLML; } if (e.x < result.left) result.left = e.x; else if (e.xtop < result.left) result.left = e.xtop; if (e.ytop < result.top) result.top = e.ytop; e = lm.rightBound; while (e.nextInLML != null) { if (e.x > result.right) result.right = e.x; e = e.nextInLML; } if (e.x > result.right) result.right = e.x; else if (e.xtop > result.right) result.right = e.xtop; lm = lm.nextLm; } return result; }
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code