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

Direction arrows fix #708

Merged
merged 5 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions src/Map/MapPresentationEnvironment_P.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,7 @@ QHash<QString, int> OsmAnd::MapPresentationEnvironment_P::getLineRenderingAttrib
{
int color = -1, shadowColor = -1, color_2 = -1, color_3 = -1;
float strokeWidth = -1.0f, strokeWidth_2 = -1.0f, strokeWidth_3 = -1.0f, shadowRadius = -1.0f;

MapStyleEvaluator evaluator(owner->mapStyle, owner->displayDensityFactor * owner->mapScaleFactor);
MapStyleEvaluator evaluator(owner->mapStyle, owner->displayDensityFactor);
applyTo(evaluator);
auto renderAttr = owner->mapStyle->getAttribute(renderAttrName);
MapStyleEvaluationResult evalResult(owner->mapStyle->getValueDefinitionsCount());
Expand Down
5 changes: 4 additions & 1 deletion src/Map/VectorLine_P.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

#define SPECIAL_ARROW_DISTANCE_MULTIPLIER 2.5f

#define VECTOR_LINE_SCALE_COEF 2.0f
#define LINE_WIDTH_THRESHOLD_DP 8.0f * VECTOR_LINE_SCALE_COEF

// Colorization shemes
#define COLORIZATION_NONE 0
#define COLORIZATION_GRADIENT 1
Expand Down Expand Up @@ -1355,7 +1358,7 @@ void OsmAnd::VectorLine_P::addArrowsOnSegmentPath(

bool OsmAnd::VectorLine_P::useSpecialArrow() const
{
return owner->specialPathIcon != nullptr && _lineWidth <= owner->specialPathIcon->width() + 3.0f;
return _lineWidth < (LINE_WIDTH_THRESHOLD_DP * owner->screenScale);
}

double OsmAnd::VectorLine_P::getPointStepPx() const
Expand Down