fixes origin and scale handling, it behaves mostly like R5 now (it is used for drawing only, yes not mouse coords or anything else). Also fixes offscreen layers clipping rebuilding when the user defined clipping is added or changed
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15040 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -59,6 +59,16 @@ class DrawState {
|
||||
float Scale() const
|
||||
{ return fScale; }
|
||||
|
||||
// coordinate transformations
|
||||
void Transform(float* x, float* y) const;
|
||||
void InverseTransform(float* x, float* y) const;
|
||||
|
||||
void Transform(BPoint* point) const;
|
||||
void Transform(BRect* rect) const;
|
||||
void Transform(BRegion* region) const;
|
||||
|
||||
void InverseTransform(BPoint* point) const;
|
||||
|
||||
// additional clipping as requested by client
|
||||
void SetClippingRegion(const BRegion& region);
|
||||
const BRegion* ClippingRegion() const
|
||||
@@ -124,8 +134,6 @@ class DrawState {
|
||||
{ return fMiterLimit; }
|
||||
|
||||
// convenience functions
|
||||
inline BPoint Transform(const BPoint& point) const;
|
||||
inline BRect Transform(const BRect& rect) const;
|
||||
void PrintToStream() const;
|
||||
|
||||
void SetSubPixelPrecise(bool precise);
|
||||
@@ -177,24 +185,6 @@ class DrawState {
|
||||
|
||||
// inline implementations
|
||||
|
||||
// Transform
|
||||
BPoint
|
||||
DrawState::Transform(const BPoint& point) const
|
||||
{
|
||||
BPoint p(point);
|
||||
p += fOrigin;
|
||||
p.x *= fScale;
|
||||
p.y *= fScale;
|
||||
return p;
|
||||
}
|
||||
|
||||
// Transform
|
||||
BRect
|
||||
DrawState::Transform(const BRect& rect) const
|
||||
{
|
||||
return BRect(Transform(rect.LeftTop()),
|
||||
Transform(rect.LeftBottom()));
|
||||
}
|
||||
/*
|
||||
// ClippingRectAt
|
||||
BRect
|
||||
|
||||
Reference in New Issue
Block a user