Definition at line 170 of file MotionMarkSlide.cpp.
◆ CanvasLineSegment()
Definition at line 172 of file MotionMarkSlide.cpp.
172 {
174
176 0xffe01040, 0xff10c030, 0xff744cba, 0xffe05010
177 };
179 fLineWidth = std::pow(random->
nextF(), 12) * 20 + 3;
180 fOmega = random->
nextF() * 3 + 0.2f;
182 fCosTheta = std::cos(theta);
183 fSinTheta = std::sin(theta);
185 params.fCircleRadius * fSinTheta);
186 fLength =
params.fLineMinimum;
187 fLength += std::pow(random->
nextF(), 8) *
params.fLineLengthMaximum;
188 fSegmentDirection = random->
nextF() > 0.5 ? -1 : 1;
189 }
float nextRangeF(float min, float max)
uint32_t nextRangeU(uint32_t min, uint32_t max)
const EmbeddedViewParams * params
static constexpr SkPoint Make(float x, float y)
◆ ~CanvasLineSegment()
CanvasLineSegment::~CanvasLineSegment |
( |
| ) |
|
|
overridedefault |
◆ animate()
void CanvasLineSegment::animate |
( |
double |
nanos | ) |
|
|
inlineoverridevirtual |
Implements MMObject.
Definition at line 207 of file MotionMarkSlide.cpp.
207 {
208 fLength += std::sin(time_counter_value(nanos, 100) * fOmega);
209 }
◆ draw()
void CanvasLineSegment::draw |
( |
SkCanvas * |
canvas | ) |
|
|
inlineoverridevirtual |
Implements MMObject.
Definition at line 193 of file MotionMarkSlide.cpp.
193 {
195 paint.setAntiAlias(
true);
196 paint.setColor(fColor);
197 paint.setStrokeWidth(fLineWidth);
199
201 fStart.
fX + fSegmentDirection * fLength * fCosTheta,
202 fStart.
fY + fSegmentDirection * fLength * fSinTheta
203 };
205 }
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
@ kStroke_Style
set to stroke geometry
The documentation for this class was generated from the following file: