Update rive-cpp to 2.0 version
[platform/core/uifw/rive-tizen.git] / submodule / rive-cpp / src / hittest_command_path.cpp
1 /*
2  * Copyright 2022 Rive
3  */
4
5 #include "rive/hittest_command_path.hpp"
6
7 using namespace rive;
8
9 HitTestCommandPath::HitTestCommandPath(const IAABB& area) : m_Area(area) { m_Tester.reset(m_Area); }
10
11 bool HitTestCommandPath::wasHit() { return m_Tester.test(m_FillRule); }
12
13 void HitTestCommandPath::reset() { m_Tester.reset(m_Area); }
14
15 void HitTestCommandPath::fillRule(FillRule value) {
16     // remember this here, and pass it to test()
17     m_FillRule = value;
18 }
19
20 void HitTestCommandPath::addPath(CommandPath* path, const Mat2D& transform) {
21     assert(false);
22     // not supported
23 }
24
25 RenderPath* HitTestCommandPath::renderPath() {
26     assert(false);
27     // not supported
28     return nullptr;
29 }
30
31 void HitTestCommandPath::moveTo(float x, float y) { m_Tester.move(m_Xform * Vec2D(x, y)); }
32
33 void HitTestCommandPath::lineTo(float x, float y) { m_Tester.line(m_Xform * Vec2D(x, y)); }
34
35 void HitTestCommandPath::cubicTo(float ox, float oy, float ix, float iy, float x, float y) {
36     m_Tester.cubic(m_Xform * Vec2D(ox, oy), m_Xform * Vec2D(ix, iy), m_Xform * Vec2D(x, y));
37 }
38
39 void HitTestCommandPath::close() { m_Tester.close(); }