Author Topic: Scaling of dy displacement with zoom  (Read 813 times)

Offline john_percy

  • Padavan of Locus
  • ***
  • Posts: 384
  • Thanked: 17 times
    • View Profile
  • Device: MotoG
Scaling of dy displacement with zoom
« on: October 11, 2016, 19:27:23 »
In a a pair of lines like
Code: [Select]
<line stroke="#B3A18F" stroke-width="0.6dp" dy="2dp" stroke-dasharray="1,8" stroke-linecap="butt" />
<line stroke="#B3A18F" stroke-width="0.1dp" stroke-linecap="butt" />
the stroke-width scales up and down with the zoom but the dy displacement does not change in the same way.

This code is intended to produce a line with ticks off to one side. As far as I can see, ideally it ought to be:
Code: [Select]
<line stroke="#B3A18F" stroke-width="0.6dp" dy="0.3dp" stroke-dasharray="1,8" stroke-linecap="butt" />
<line stroke="#B3A18F" stroke-width="0.1dp" stroke-linecap="butt" />
with teh displacement and the width scaling exactly the same way.
 

Offline Tobias

  • More than Newbie
  • *
  • Posts: 72
  • Thanked: 2 times
    • View Profile
    • Elevate themes
Re: Scaling of dy displacement with zoom
« Reply #1 on: October 12, 2016, 10:30:27 »
+1

There was a similar issues in standard mapsforge 0.5 which was fixed in 0.5.1, discussion and issue here:
https://groups.google.com/d/msg/mapsforge-dev/xQHb-CNxlag/UxiDgFXyyLMJ
https://github.com/mapsforge/mapsforge/issues/580

The problem is that stroke width is scaled for zoom levels >12 with a base 1.5, so strokes get wider, but everything defined by dy keeps the same distance, so it looks like it moves relative to another object which hasn't the same dy value.
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 10003
  • Thanked: 64 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: Scaling of dy displacement with zoom
« Reply #2 on: October 12, 2016, 12:12:31 »
Hello John, Tobias,
thanks for a feedback. I'll enable this improvement to next BETA version, so there will be some time to test it.
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline Tobias

  • More than Newbie
  • *
  • Posts: 72
  • Thanked: 2 times
    • View Profile
    • Elevate themes
Re: Scaling of dy displacement with zoom
« Reply #3 on: November 12, 2016, 16:05:07 »
Hello John, Tobias,
thanks for a feedback. I'll enable this improvement to next BETA version, so there will be some time to test it.
After checking with the last beta versions, still same behavior - probably planning for beta version 3.21 instead 3.20.x?
 

Offline john_percy

  • Padavan of Locus
  • ***
  • Posts: 384
  • Thanked: 17 times
    • View Profile
  • Device: MotoG
Re: Scaling of dy displacement with zoom
« Reply #4 on: December 05, 2016, 10:48:28 »
@menion: Is this still on track?
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 10003
  • Thanked: 64 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: Scaling of dy displacement with zoom
« Reply #5 on: December 07, 2016, 10:03:04 »
Ah sorry guys!
I've included this change into one of previous versions, but @voldapet stopped me because he had some troubles in compatibility with Locus internal themes. And then I've forget on this topic, sorry.

As I think about it, best should be add extra parameter to keep current system compatible with old and new themes.

So in next version of Locus Map will themes support parameter "scale-line-dy-by-zoom" in header of themes. So will be able to add aditional argument scale-line-dy-by-zoom="1" , which enable this required scaling. Possible? Let me know how it works in next Beta version (probably tomorrow ).

So example of such locus internal theme header:

Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<rendertheme xmlns="http://mapsforge.org/renderTheme"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://mapsforge.org/renderTheme https://raw.githubusercontent.com/mapsforge/mapsforge/dev/resources/renderTheme.xsd"
  version="1"
  locus-extended="1"
  fill-sea-areas="0"
  map-background="#ebeade"
  scale-line-dy-by-zoom="1">
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline john_percy

  • Padavan of Locus
  • ***
  • Posts: 384
  • Thanked: 17 times
    • View Profile
  • Device: MotoG
Re: Scaling of dy displacement with zoom
« Reply #6 on: December 07, 2016, 11:12:10 »
That sounds like the best solution. I await the next beta. :)
 

Offline Tobias

  • More than Newbie
  • *
  • Posts: 72
  • Thanked: 2 times
    • View Profile
    • Elevate themes
Re: Scaling of dy displacement with zoom
« Reply #7 on: December 19, 2016, 14:05:17 »
I finally came around to test it, works great for me in the latest beta. No more "moving" ways.
Thanks menion!
 

Offline menion

  • Administrator
  • Professor of Locus
  • *****
  • Posts: 10003
  • Thanked: 64 times
    • View Profile
    • http://www.asamm.com
  • Device: SGS7
Re: Scaling of dy displacement with zoom
« Reply #8 on: December 19, 2016, 15:49:06 »
Glad to hear it. Current solution is usable for you without any issue right? Our internal themes stay unaffected, other themes as well ... hmm I see no problem, perfect. I'm just preparing new version, release will be probably tomorrow.
Ideas, wishes, problems
Advanced topics, public discussion, sharing of knowledges, testing beta versions: you're here!
 

Offline john_percy

  • Padavan of Locus
  • ***
  • Posts: 384
  • Thanked: 17 times
    • View Profile
  • Device: MotoG
Re: Scaling of dy displacement with zoom
« Reply #9 on: December 19, 2016, 17:00:30 »
It works fine for me too. Many thanks.