Added BShape::CurrentPoint(), returning the current end point of the path.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35908 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
cfefeee3f8
commit
00873f7818
@ -63,6 +63,7 @@ public:
|
||||
|
||||
void Clear();
|
||||
BRect Bounds() const;
|
||||
BPoint CurrentPosition() const;
|
||||
|
||||
status_t AddShape(const BShape* other);
|
||||
|
||||
|
@ -301,13 +301,13 @@ BShape::Bounds() const
|
||||
if (data->ptCount == 0)
|
||||
return bounds;
|
||||
|
||||
// TODO: This implementation doesn't take into account curves at all.
|
||||
bounds.left = data->ptList[0].x;
|
||||
bounds.top = data->ptList[0].y;
|
||||
bounds.right = data->ptList[0].x;
|
||||
bounds.bottom = data->ptList[0].y;
|
||||
|
||||
for (int32 i = 1; i < data->ptCount; i++)
|
||||
{
|
||||
for (int32 i = 1; i < data->ptCount; i++) {
|
||||
if (bounds.left > data->ptList[i].x)
|
||||
bounds.left = data->ptList[i].x;
|
||||
if (bounds.top > data->ptList[i].y)
|
||||
@ -322,6 +322,18 @@ BShape::Bounds() const
|
||||
}
|
||||
|
||||
|
||||
BPoint
|
||||
BShape::CurrentPosition() const
|
||||
{
|
||||
shape_data* data = (shape_data*)fPrivateData;
|
||||
|
||||
if (data->ptCount == 0)
|
||||
return B_ORIGIN;
|
||||
|
||||
return data->ptList[data->ptCount - 1];
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BShape::AddShape(const BShape* otherShape)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user