summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4512dff)
}
error += dy;
if (error > 0) {
}
error += dy;
if (error > 0) {
- y += ystep;
- error -= dx;
+ y += ystep;
+ error -= dx;
}
}
return new ResultPointsAndTransitions(from, to, transitions);
}
}
return new ResultPointsAndTransitions(from, to, transitions);
// Now count other way -- don't run off image though of course
int otherToX = fromX - (toX - fromX);
if (otherToX < 0) {
// Now count other way -- don't run off image though of course
int otherToX = fromX - (toX - fromX);
if (otherToX < 0) {
- // "to" should the be the first value not included, so, the first value off
- // the edge is -1
- otherToX = -1;
- } else if (otherToX > image.getWidth()) {
- otherToX = image.getWidth();
+ otherToX = 0;
+ } else if (otherToX >= image.getWidth()) {
+ otherToX = image.getWidth() - 1;
}
int otherToY = fromY - (toY - fromY);
if (otherToY < 0) {
}
int otherToY = fromY - (toY - fromY);
if (otherToY < 0) {
- otherToY = -1;
- } else if (otherToY > image.getHeight()) {
- otherToY = image.getHeight();
+ otherToY = 0;
+ } else if (otherToY >= image.getHeight()) {
+ otherToY = image.getHeight() - 1;
}
result += sizeOfBlackWhiteBlackRun(fromX, fromY, otherToX, otherToY);
return result - 1.0f; // -1 because we counted the middle pixel twice
}
result += sizeOfBlackWhiteBlackRun(fromX, fromY, otherToX, otherToY);
return result - 1.0f; // -1 because we counted the middle pixel twice
}
error += dy;
if (error > 0) {
}
error += dy;
if (error > 0) {
- y += ystep;
- error -= dx;
+ y += ystep;
+ error -= dx;
}
}
int diffX = toX - fromX;
}
}
int diffX = toX - fromX;
addTest(36, 36, 0.0f);
addTest(37, 37, 90.0f);
addTest(35, 35, 180.0f);
addTest(36, 36, 0.0f);
addTest(37, 37, 90.0f);
addTest(35, 35, 180.0f);
- addTest(37, 37, 270.0f);
+ addTest(36, 36, 270.0f);