2 * Copyright 2006-2008, Haiku.
3 * Distributed under the terms of the MIT License.
6 * Artur Wyszynski <harakash@gmail.com>
11 #include <GradientLinear.h>
15 BGradientLinear::BGradientLinear()
17 fData
.linear
.x1
= 0.0f
;
18 fData
.linear
.y1
= 0.0f
;
19 fData
.linear
.x2
= 0.0f
;
20 fData
.linear
.y2
= 0.0f
;
26 BGradientLinear::BGradientLinear(const BPoint
& start
, const BPoint
& end
)
28 fData
.linear
.x1
= start
.x
;
29 fData
.linear
.y1
= start
.y
;
30 fData
.linear
.x2
= end
.x
;
31 fData
.linear
.y2
= end
.y
;
37 BGradientLinear::BGradientLinear(float x1
, float y1
, float x2
, float y2
)
49 BGradientLinear::Start() const
51 return BPoint(fData
.linear
.x1
, fData
.linear
.y1
);
57 BGradientLinear::SetStart(const BPoint
& start
)
59 fData
.linear
.x1
= start
.x
;
60 fData
.linear
.y1
= start
.y
;
66 BGradientLinear::SetStart(float x
, float y
)
75 BGradientLinear::End() const
77 return BPoint(fData
.linear
.x2
, fData
.linear
.y2
);
83 BGradientLinear::SetEnd(const BPoint
& end
)
85 fData
.linear
.x2
= end
.x
;
86 fData
.linear
.y2
= end
.y
;
92 BGradientLinear::SetEnd(float x
, float y
)