summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bacf092)
raw | patch | inline | side by side (parent: bacf092)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 23 Dec 2007 21:36:31 +0000 (21:36 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 23 Dec 2007 21:36:31 +0000 (21:36 +0000) |
src/2geom/d2-sbasis.cpp | patch | blob | history |
index c5c005c24b711f152d62622e9851245e5738eb00..8cf24627e3a85cb4356297dfed472aac59c01502 100644 (file)
--- a/src/2geom/d2-sbasis.cpp
+++ b/src/2geom/d2-sbasis.cpp
if (tol<=0 || L2sq(pt0-pt1)<tol*tol){
pt0 = (pt0+pt1)/2;
for (unsigned dim=0; dim<2; dim++){
- result.segs[prev][dim][0][1]=pt0[dim];
- result.segs[cur ][dim][0][0]=pt0[dim];
+ SBasis &prev_sb=result.segs[prev][dim];
+ SBasis &cur_sb =result.segs[cur][dim];
+ Coord const c=pt0[dim];
+ if (prev_sb.empty()) {
+ prev_sb.push_back(Linear(0.0, c));
+ } else {
+ prev_sb[0][1] = c;
+ }
+ if (cur_sb.empty()) {
+ cur_sb.push_back(Linear(c, 0.0));
+ } else {
+ cur_sb[0][0] = c;
+ }
}
}
prev = cur++;