New issue
 Projects > js > Issues > Bug #3406

Screen adaptation on mobile version: Canvas width calculation with 1px error

Bug #3406 [Closed]
pandamicro 2013-12-16 09:03 . Updated almost 3 years ago

Sometimes the viewport calculation is mistaken with 1px blank espace on the right side of the canvas for SHOW_ALL resolution policy.

pandamicro 2013-12-16 09:22
  • % Done changed from 0 to 100

In the previous version, horizontal alignement is affected by “textAlign” css style, but this isn’t very reliable and create sometimes such tiny errors.
So now, I calculate the offset of our canvas element and set the offset to the padding value of its parent. Note that margin / padding doesn’t take float value, so I used integer precision in these offset values.

pandamicro 2013-12-16 09:23
  • Status changed from New to Closed

Atom PDF

Start date:2013-12-16
Due date:
% Done:


Target version:v2.2.2

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.