Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas rendering looks very pixelated on Retina screens #13

Open
heartcode opened this issue Nov 20, 2012 · 4 comments
Open

Canvas rendering looks very pixelated on Retina screens #13

heartcode opened this issue Nov 20, 2012 · 4 comments
Assignees

Comments

@heartcode
Copy link
Owner

The loader is not retina ready at the moment, it would be great to make it somewhat responsive and retinafied.

Some ideas:
http://stackoverflow.com/questions/12618052/html5-canvas-can-i-draw-really-sharp-on-non-retina-devices-like-ipad2

@deepfriedmind
Copy link

Agreed. Would be great if this could be fixed somehow.

@heartcode heartcode self-assigned this Apr 25, 2014
@rozzy
Copy link

rozzy commented May 23, 2014

Hey guys. I was trying to resolve this issue for an hour and after several unsuccessful attempts i found a very funny, but working solution. Instead of playing with canvas width and height, i am trying to scale it:

var cl = new CanvasLoader('analysis_loader'),
    diameter = 44;
cl.setColor('#ffffff');
cl.setShape('spiral');
cl.setDiameter(diameter);
cl.setDensity(149);
cl.setRange(0.6);
cl.setSpeed(1);
cl.setFPS(60);
if (window.devicePixelRatio) {
  cl.setDiameter(diameter * 2);
  $('canvas').css({
    '-webkit-transform': 'scale(0.5)',
    '-webkit-transform-origin': 'top left',
    '-moz-transform': 'scale(0.5)',
    '-moz-transform-origin': 'top left',
    'transform': 'scale(0.5)',
    'transform-origin': 'top left',
  });
};
cl.show();

It works fine in Mac OS X browsers at latest MBPr: Safari, Firefox, Chrome, Yandex.Browser and latest Opera. Also it must be working at iOS retina devices.

I am not sure about windows retina devices, but if anybody have one, please reply to this message with feedback (work/not work).

Cheers from http://pocketdj.ru :-)

@robpataki
Copy link

Hey rozzy! Thank you very much for your effort, much appreciated! I have been working on an updated version of CanvasLoader and it will be shipped very soon (just have been very busy with client work lately). In the new version this issue has been addressed already, please sit tight, updates are coming soon! Thank you very much for everyone for being patient and giving feedback on the issues, many thanks!

@artemgordinskiy
Copy link

Hey Robert,
I guess you don't have the time to fix this issue right now. Any way I could help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants