Skip to content

Commit

Permalink
Use SVG arrows instead of PNGs
Browse files Browse the repository at this point in the history
  • Loading branch information
tumic0 committed Nov 13, 2024
1 parent a992791 commit 734ba4b
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 11 deletions.
6 changes: 2 additions & 4 deletions gpxsee.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

<!-- Common map stuff -->
<qresource prefix="/map">
<file alias="arrow.png">icons/map/arrow.png</file>
<file alias="[email protected]">icons/map/[email protected]</file>
<file alias="water-arrow.png">icons/map/water-arrow.png</file>
<file alias="[email protected]">icons/map/[email protected]</file>
<file alias="arrow.svg">icons/map/arrow.svg</file>
<file alias="water-arrow.svg">icons/map/water-arrow.svg</file>
</qresource>

<!-- POIs (IMG & ENC style) -->
Expand Down
Binary file removed icons/map/arrow.png
Binary file not shown.
12 changes: 12 additions & 0 deletions icons/map/arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed icons/map/[email protected]
Binary file not shown.
Binary file removed icons/map/water-arrow.png
Binary file not shown.
12 changes: 12 additions & 0 deletions icons/map/water-arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed icons/map/[email protected]
Binary file not shown.
10 changes: 3 additions & 7 deletions src/map/IMG/rastertile.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <QFont>
#include <QPainter>
#include <QCache>
#include "common/util.h"
#include "map/dem.h"
#include "map/textpathitem.h"
#include "map/textpointitem.h"
Expand All @@ -21,11 +22,6 @@ using namespace IMG;
#define AREA(rect) \
(rect.size().width() * rect.size().height())

#define HIDPI_IMG(dir, basename, ratio) \
(((ratio) > 1.0) \
? QImage(dir "/" basename "@2x.png") \
: QImage(dir "/" basename ".png"))

#define ROAD 0
#define WATER 1

Expand Down Expand Up @@ -517,8 +513,8 @@ void RasterTile::render()
QList<TextItem*> textItems;
QImage arrows[2];

arrows[ROAD] = HIDPI_IMG(":/map", "arrow", _ratio);
arrows[WATER] = HIDPI_IMG(":/map", "water-arrow", _ratio);
arrows[ROAD] = Util::svg2img(":/map/arrow.svg", _ratio);
arrows[WATER] = Util::svg2img(":/map/water-arrow.svg", _ratio);

fetchData(polygons, lines, points);
ll2xy(polygons);
Expand Down

0 comments on commit 734ba4b

Please sign in to comment.