* 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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user