Slight refraction when viewing vector data behind raster data

OseiOsei Global Mapper UserPosts: 119Trusted User
edited January 2011 in SDK
I am having a small problem with rendering vector data when they are behind a translucent raster layer. They seem to be a little refracted (shifted) when behind.

I have attached modified source code of the C++ sample app (source.zip) that tries to reproduce problem. The source has be unzipped and the GM libraries added to the DEBUG folder.

To reproduce problem
1. Unzip data into folder
2. Load "testa.shp" by clicking "Load New Layer..." button. Accept UTM Zone 15 projection.
3. Load "grid.xyz" in similar way as an Elevation Grid layer.
4. Select grid.xyz in the listbox and click "Cycle Opacity" button to make grid translucent.
5. You would notice that the first vertical line is shifted by about 1 pixel.
6. Click "Toggle Visibility" button to toggle visibility of grid layer and the line goes straight when grid is off and shifted when grid is on.

To reproduce it in GM9 is a little more difficult
1. Load "testa.shp". Accept UTM Zone 15
2. Load "grid.xyz" in similar fashion as Elevation Grid layer
3. Click "Zoom out" button once
4. Make elevation layer transparent
5. In Configuration dialog->Vector Display tab, choose "Order Vector Features by Layer Order First"
6. First vertical line is shifted slightly and toggling on and off visibility of grid layer straightens line.

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited January 2011
    Thanks for the data to reproduce this issue. I was able to reproduce this in GM12 and find the issue. Basically there were some coordinates being rounded to pixel coordinates rather than truncated, resulting in a one pixel shift half of the time for anything rendered under a translucent layer. I have placed a new SDK build with this fixed at http://www.globalmapper.com/GlobalMapperSDK_v136_beta.zip for you to try.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • OseiOsei Global Mapper User Posts: 119Trusted User
    edited January 2011
    Thanks a lot Mike for the update. I am using the updated SDK now but it seems I still get the shift. This time it is a vertical shift. The second vertical line shifts up and down. The first horizontal line is now OK by the way.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited January 2011
    I'll take a look and see if I still get the shift. It could be I updated the SDK wrong as I was just testing in Global Mapper.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited January 2011
    I've been looking at this and think I have it licked, turned out to be a tougher problem than I originally thought. I have placed an updated SDK built at http://www.globalmapper.com/GlobalMapperSDK_v136_beta.zip that will hopefully fix it for you.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
Sign In or Register to comment.