* a VectorPath can transform all it's points using a given

Transformable, should have been part of the last commit...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18556 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2006-08-21 18:19:16 +00:00
parent bd04a1e761
commit 2d8b47105a
2 changed files with 19 additions and 0 deletions
+17
View File
@@ -31,6 +31,7 @@
# include "Icons.h"
# include "Property.h"
# include "PropertyObject.h"
# include "Transformable.h"
#endif // ICON_O_MATIC
#define obj_new(type, n) ((type *)malloc ((n) * sizeof(type)))
@@ -921,6 +922,22 @@ VectorPath::Reverse()
_NotifyPathReversed();
}
// ApplyTransform
void
VectorPath::ApplyTransform(const Transformable& transform)
{
if (transform.IsIdentity())
return;
for (int32 i = 0; i < fPointCount; i++) {
transform.Transform(&(fPath[i].point));
transform.Transform(&(fPath[i].point_out));
transform.Transform(&(fPath[i].point_in));
}
_NotifyPathChanged();
}
// PrintToStream
void
VectorPath::PrintToStream() const
+2
View File
@@ -24,6 +24,7 @@
class BBitmap;
class BMessage;
class BView;
class Transformable;
struct control_point {
BPoint point; // actual point on path
@@ -154,6 +155,7 @@ class VectorPath {
void CleanUp();
void Reverse();
void ApplyTransform(const Transformable& transform);
void PrintToStream() const;