Skip to content

Commit

Permalink
refix android lines to origin
Browse files Browse the repository at this point in the history
  • Loading branch information
altalk23 committed Jul 19, 2024
1 parent 2b22672 commit abff285
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v0.3.3-alpha
* Properly fix lines to origin in curve drawing for Android

## v0.3.2-alpha
* Added Custom Keybinds as a dependency for all platforms
* Prevent scale resetting by not generating tiny scaled objects (< 0.001)
Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"win": "2.206",
"android": "2.206"
},
"version": "v0.3.2-alpha",
"version": "v0.3.3-alpha",
"id": "alk.allium",
"name": "Allium Drawing Tool",
"developer": "alk",
Expand Down
5 changes: 3 additions & 2 deletions src/util/CurveBrushDrawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ void CurveBrushDrawer::handleTouchMove(cocos2d::CCPoint const& point) {
void CurveBrushDrawer::handleTouchEnd(cocos2d::CCPoint const& point) {
CurveBrushDrawer::handleTouchMove(point);
this->updateOverlay();
m_previousPoints.insert(m_previousPoints.end(), m_currentPoints.begin(), m_currentPoints.end());
if (m_currentPoints.size() > 1) {
m_previousPoints.insert(m_previousPoints.end(), m_currentPoints.begin(), m_currentPoints.end() - 1);
}
m_currentPoints.clear();
}

Expand All @@ -73,7 +75,6 @@ PolylineConverter CurveBrushDrawer::initializeConverter() {
points.push_back({point[0], point[1]});
}
for (auto const& point : m_currentPoints) {
if (m_previousPoints.size() > 0 && m_previousPoints.back() == point) continue;
points.push_back({point[0], point[1]});
}
return PolylineConverter(BrushManager::get()->getLineWidth(), std::move(points));
Expand Down

0 comments on commit abff285

Please sign in to comment.