Fixed double conversion from view to screen space I introduced with the previous
commit. PictureTest at least works again. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35910 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -88,9 +88,7 @@ ShapePainter::IterateMoveTo(BPoint* point)
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
fOpStack.push(OP_MOVETO);
|
fOpStack.push(OP_MOVETO);
|
||||||
BPoint transformed(*point);
|
fPtStack.push(*point);
|
||||||
fView->ConvertToScreenForDrawing(&transformed);
|
|
||||||
fPtStack.push(transformed);
|
|
||||||
} catch (std::bad_alloc) {
|
} catch (std::bad_alloc) {
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -104,11 +102,8 @@ ShapePainter::IterateLineTo(int32 lineCount, BPoint* linePts)
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
fOpStack.push(OP_LINETO | lineCount);
|
fOpStack.push(OP_LINETO | lineCount);
|
||||||
for (int32 i = 0; i < lineCount; i++) {
|
for (int32 i = 0; i < lineCount; i++)
|
||||||
BPoint transformed(linePts[i]);
|
fPtStack.push(linePts[i]);
|
||||||
fView->ConvertToScreenForDrawing(&transformed);
|
|
||||||
fPtStack.push(transformed);
|
|
||||||
}
|
|
||||||
} catch (std::bad_alloc) {
|
} catch (std::bad_alloc) {
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -123,11 +118,8 @@ ShapePainter::IterateBezierTo(int32 bezierCount, BPoint* bezierPts)
|
|||||||
bezierCount *= 3;
|
bezierCount *= 3;
|
||||||
try {
|
try {
|
||||||
fOpStack.push(OP_BEZIERTO | bezierCount);
|
fOpStack.push(OP_BEZIERTO | bezierCount);
|
||||||
for (int32 i = 0; i < bezierCount; i++) {
|
for (int32 i = 0; i < bezierCount; i++)
|
||||||
BPoint transformed(bezierPts[i]);
|
fPtStack.push(bezierPts[i]);
|
||||||
fView->ConvertToScreenForDrawing(&transformed);
|
|
||||||
fPtStack.push(transformed);
|
|
||||||
}
|
|
||||||
} catch (std::bad_alloc) {
|
} catch (std::bad_alloc) {
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -155,11 +147,9 @@ ShapePainter::IterateArcTo(float& rx, float& ry,
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
fOpStack.push(op | 3);
|
fOpStack.push(op | 3);
|
||||||
fPtStack.push(BPoint(rx * fView->Scale(), ry * fView->Scale()));
|
fPtStack.push(BPoint(rx, ry));
|
||||||
fPtStack.push(BPoint(angle, 0));
|
fPtStack.push(BPoint(angle, 0));
|
||||||
BPoint transformed(point);
|
fPtStack.push(point);
|
||||||
fView->ConvertToScreenForDrawing(&transformed);
|
|
||||||
fPtStack.push(transformed);
|
|
||||||
} catch (std::bad_alloc) {
|
} catch (std::bad_alloc) {
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -211,7 +201,7 @@ ShapePainter::Draw(BRect frame, bool filled)
|
|||||||
fPtStack.pop();
|
fPtStack.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
BPoint offset;
|
BPoint offset(fView->CurrentState()->PenLocation());
|
||||||
fView->ConvertToScreenForDrawing(&offset);
|
fView->ConvertToScreenForDrawing(&offset);
|
||||||
fView->Window()->GetDrawingEngine()->DrawShape(frame, opCount,
|
fView->Window()->GetDrawingEngine()->DrawShape(frame, opCount,
|
||||||
opList, ptCount, ptList, filled, offset, fView->Scale());
|
opList, ptCount, ptList, filled, offset, fView->Scale());
|
||||||
|
|||||||
Reference in New Issue
Block a user