Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove radial line from ofpath::arc and ofPath::arcNegative #6224

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions libs/openFrameworks/graphics/ofPath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ void ofPath::arc(const glm::vec2 & centre, float radiusX, float radiusY, float a
//----------------------------------------------------------
void ofPath::arc(const glm::vec3 & centre, float radiusX, float radiusY, float angleBegin, float angleEnd){
if(mode==COMMANDS){
//addCommand adds a moveTo if one hasn't been set, but in this case it is adding a moveTo to the center of the arc and not the beginning of the arc
if(commands.empty() || commands.back().type==Command::close){
glm::vec3 start = centre + glm::vec3( glm::cos( glm::radians(angleBegin) ) * radiusX, glm::sin( glm::radians(angleBegin) ) * radiusY, 0.0f );
commands.push_back(Command(Command::moveTo,start));
}
addCommand(Command(Command::arc,centre,radiusX,radiusY,angleBegin,angleEnd));
}else{
lastPolyline().arc(centre,radiusX,radiusY,angleBegin,angleEnd,circleResolution);
Expand All @@ -237,6 +242,10 @@ void ofPath::arc(float x, float y, float z, float radiusX, float radiusY, float
//----------------------------------------------------------
void ofPath::arcNegative(const glm::vec3 & centre, float radiusX, float radiusY, float angleBegin, float angleEnd){
if(mode==COMMANDS){
if(commands.empty() || commands.back().type==Command::close){
glm::vec3 start = centre + glm::vec3( glm::cos( glm::radians(angleBegin) ) * radiusX, glm::sin( glm::radians(angleBegin) ) * radiusY, 0.0f );
commands.push_back(Command(Command::moveTo,start));
}
addCommand(Command(Command::arcNegative,centre,radiusX,radiusY,angleBegin,angleEnd));
}else{
lastPolyline().arcNegative(centre,radiusX,radiusY,angleBegin,angleEnd,circleResolution);
Expand Down