class/namespace. Renamed the B_GRADIENT_* types to TYPE_* as the context is already given. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28564 a95241bf-73f2-0310-859d-f6bbb57e9c96
84 lines
1.2 KiB
C++
84 lines
1.2 KiB
C++
/*
|
|
* Copyright 2006-2008, Haiku.
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Authors:
|
|
* Artur Wyszynski <[email protected]>
|
|
*/
|
|
|
|
#include <Point.h>
|
|
#include <Gradient.h>
|
|
#include <GradientConic.h>
|
|
|
|
|
|
// constructor
|
|
BGradientConic::BGradientConic()
|
|
{
|
|
fData.conic.cx = 0.0f;
|
|
fData.conic.cy = 0.0f;
|
|
fData.conic.angle = 0.0f;
|
|
fType = TYPE_CONIC;
|
|
}
|
|
|
|
|
|
// constructor
|
|
BGradientConic::BGradientConic(const BPoint& center, float angle)
|
|
{
|
|
fData.conic.cx = center.x;
|
|
fData.conic.cy = center.y;
|
|
fData.conic.angle = angle;
|
|
fType = TYPE_CONIC;
|
|
}
|
|
|
|
|
|
// constructor
|
|
BGradientConic::BGradientConic(float cx, float cy, float angle)
|
|
{
|
|
fData.conic.cx = cx;
|
|
fData.conic.cy = cy;
|
|
fData.conic.angle = angle;
|
|
fType = TYPE_CONIC;
|
|
}
|
|
|
|
|
|
// Center
|
|
BPoint
|
|
BGradientConic::Center() const
|
|
{
|
|
return BPoint(fData.conic.cx, fData.conic.cy);
|
|
}
|
|
|
|
|
|
// SetCenter
|
|
void
|
|
BGradientConic::SetCenter(const BPoint& center)
|
|
{
|
|
fData.conic.cx = center.x;
|
|
fData.conic.cy = center.y;
|
|
}
|
|
|
|
|
|
// SetCenter
|
|
void
|
|
BGradientConic::SetCenter(float cx, float cy)
|
|
{
|
|
fData.conic.cx = cx;
|
|
fData.conic.cy = cy;
|
|
}
|
|
|
|
|
|
// Angle
|
|
float
|
|
BGradientConic::Angle() const
|
|
{
|
|
return fData.conic.angle;
|
|
}
|
|
|
|
|
|
// SetAngle
|
|
void
|
|
BGradientConic::SetAngle(float angle)
|
|
{
|
|
fData.conic.angle = angle;
|
|
}
|