Odd Display Difference between Simulator and Venu Device

I have report from a user that a data field of mine is not displaying properly.  When I test this on the simulator all looks OK.  Any ideas?

Looks like the width being reported by the device is greater than the actual width, so pushing the centre to the right?

Code snippet of code used to draw this:

absoluteCenterX = dc.getWidth() / 2;
absoluteCenterY = dc.getHeight()  / 2;
 
dc.setPenWidth(8);
dc.setColor(Gfx.COLOR_ORANGE, Gfx.COLOR_BLACK);
dc.drawArc(absoluteCenterX, absoluteCenterY, absoluteCenterX - 4, 1, zone3End, zone4End);

  • One thing is that in the sim, the 8 pixel pen with on a venu is the same with as an 8 pixel pen on a 240x240 device.  8 screen pixels.  That's why a venu in the sim looks much bigger that a 240x240 device, as it's actually 390 pixels wide..  This will show on a real device, by 8 pixels being a smaller present of the width on a venu (and therefore look narrower) than on a 240x240 device, where the actual screens themselves are about the same size..

    What you can do is instead of using a fixed setPenWidth, base that on the actual screen width, so the arc is wider on a venu than a lower res device.

    So, if the width is 240, dividing that by 8 gives you a pen with of 8, and if you do the same on a venu, 390/30 gives you a pen width of 13 for example.

  • Thanks, but it doesn't look to be a pen width problem as the width of the arc is fine on the left hand side.  It seems to be that the radius of the arc and the centre are off from the sim to the real device?  Or am I missing something?

  • Understand that width/2 and height/2 aren't the exact center of 390x390  With an even number, you can't actual get the exact center, as there's no such thing as a half pixel.  What can happen is a slight shift to the right and down 1.  Also if the bezel is off a hair, that could add to the offset.  What you want to do is make sure the pen width/radius can account for things like this.

    so, things like

    var penW=width/30;

    var radius=width-penW/2;

  • This arc looks to be off more than 0.5-1 pixel.  Also you can see one the device image that the top horizontal bar leaks out from the arc on the top left so it doesn't look like a mechanical bezel issue.

    From the device picture the arc is clipping slightly at the bottom left but clipping a lot more at the bottom right.  Which makes me think the arc radius to too large AND the centre is offset to the right.  I'll try the above but I can't see how this will provide the correct centre.

  • Conside this.

    Let's say you have 3 pixels, all the same size.  Where is the middle one?  Obviously the x,y of the second 2nd one.  Now if you have 4 pixels, there is no center one.  You have 2 to the right and 2 to the left.  If you use the first one to the right, the center is shifted to the center of the first pixel to the right as you can use the actual point where the second and 3rd pixels meet.

  • 3x3
    
     X
    XXX
     X
     
    4x4
      X
    XXXX
      X
      X
      
    or
     X
     X
    XXXX
     X

    with an odd number there is a center pixel, with an even number, it'; shifter 1 to the right or left.

  • I've made the change and asked the user to re-test.  Hope it works.  Thanks

  • Sorry no joy, made no visible difference

  • What penwidth are you using on the venu?  Maybe have the user try other watch faces in the store and see if they are similar?

  • As you suggested I changed to

    var penWidth =  widthX/40; 	
    dc.setPenWidth(penWidth);
    
    dc.drawArc(absoluteCenterX, absoluteCenterY, absoluteCenterX - penWidth/2, 1, zone3End, zone4End);

    Just got another update from the user it now seems to display in the centre but looks to be too low

    What is the best method to pull this central on the Venu but also be central on the other devices?  Do I just need to test for even screen size and reduce by 0.5 if it is?

    Updated code above with arc drawing code