Skip to content

Commit

Permalink
Merge pull request #21722 from osmandapp/rzr-import-colors
Browse files Browse the repository at this point in the history
Fix default color after track import / fix wrong color in db/ext (use null instead of 0)
  • Loading branch information
alex-osm authored Jan 14, 2025
2 parents 10c5230 + 13e70fe commit 6c6489e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class GpxDataItem(

fun readGpxAppearanceParameter(gpxFile: GpxFile, parameter: GpxParameter) {
when (parameter) {
GpxParameter.COLOR -> setParameter(GpxParameter.COLOR, gpxFile.getColor(0))
GpxParameter.COLOR -> setParameter(GpxParameter.COLOR, gpxFile.getColor(null))
GpxParameter.WIDTH -> setParameter(GpxParameter.WIDTH, gpxFile.getWidth(null))
GpxParameter.SHOW_ARROWS ->
setParameter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ class GpxFile : GpxExtensions {
val tpoints = mutableListOf<TrkSegment>()
if (routes.isNotEmpty()) {
for (route in routes) {
val routeColor = route.getColor(getColor(0))
val routeColor = route.getColor(getColor(null))
if (route.points.isNotEmpty()) {
val ts = TrkSegment()
tpoints.add(ts)
Expand All @@ -491,7 +491,7 @@ class GpxFile : GpxExtensions {
fun processPoints(): List<TrkSegment> {
val tpoints = mutableListOf<TrkSegment>()
for (track in tracks) {
val trackColor = track.getColor(getColor(0))
val trackColor = track.getColor(getColor(null))
for (segment in track.segments) {
val segmentColor = segment.getColor(trackColor)
if (!segment.generalSegment && segment.points.isNotEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import net.osmand.IndexConstants;
import net.osmand.NativeLibrary.RenderedObject;
import net.osmand.PlatformUtil;
import net.osmand.RenderingContext;
Expand Down Expand Up @@ -80,7 +79,6 @@

import org.apache.commons.logging.Log;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
Expand Down

0 comments on commit 6c6489e

Please sign in to comment.