Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

NaN issue in MapView::drawScale #2347

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments
Closed

NaN issue in MapView::drawScale #2347

openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments

Comments

@openstreetmap-trac
Copy link

Reporter: mloskot
[Submitted to the original trac issue database at 5.50pm, Friday, 2nd October 2009]

Using Merkaartor from current trunk (r17945) built using Visual C++ 8.0 and Qt 4.5.3 on Windows XP.

First launch of Merkaartor (under VS debugger) causes assertion caught in QRasterizer::rasterizeLine:

 Q_ASSERT(width > 0.0);

because sometimes the width is NaN. The NaN value is forced by NaN result of [source:applications/editors/merkaartor/src/MapView.cpp@16698#L236 log calculation in MapView::drawScale] function.

I attached patch that shows where is the problem and applies a sort of escape fix - simple isnan() based check - that prevents execution stops. However, the real fix needs to be provided to that math.

@openstreetmap-trac
Copy link
Author

Author: Koying
[Added to the original trac issue at 1.25pm, Saturday, 3rd October 2009]

Strange... Never had this assert before... Might be something new in 4.5.3

@openstreetmap-trac
Copy link
Author

Author: koying
[Added to the original trac issue at 1.32pm, Saturday, 3rd October 2009]

(In [17970]) FIX : assert when drawing scale (fixes #2347)

@openstreetmap-trac
Copy link
Author

Author: mloskot
[Added to the original trac issue at 4.30pm, Saturday, 3rd October 2009]

Indeed, I've in observed a random nature of this particular issue. Somewhat related to on-load size of the application Window, but haven't had time to debug it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant