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

Patch for HiDPI display #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tsaiid
Copy link

@tsaiid tsaiid commented Aug 20, 2015

Current version of pcman-firefox does not support HiDPI display (previous issue #38 on google code).

This PR will detect the devicePixelRatio (for example, with a retina display on MacBook, the ratio is 2), and then draws the canvas in HiDPI, and then scale down for display.

It was only tested on MacBook Pro Retina 15". No other devices with HiDPI available for testing.

@u881831
Copy link
Contributor

u881831 commented Jul 29, 2016

Firefox在這部分的表現非常奇怪,在網頁canvas寬度和高度都是用canvas.style.width/height(pcman-chrome CommonCore branch,使用Firefox當UI),可是在xul高度用canvas.style.height寬度用canvas.width,必須另外指定canvas.style.position='fixed'才能讓寬度用canvas.style.width。這邊只要再調整一下被動到的其他元件的話應該沒什麼大問題。

另外照規範devicePixelRatio應該要隨頁面縮放改變,在網頁和e10s branch中表現正常,可是套用這個patch的master branch不會隨頁面縮放改變,必須用window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindowUtils).screenPixelsPerCSSPixel才能得到規範中正確的值。不過用正確的值雖然可以讓文字不會因為縮放而糊掉但是字和字中間會出現黑框,似乎會變得比原來更糟。

因為這些行為看起來不像是故意設計的,很有可能在其他環境出現出乎意料的行為,我想應該要在更多平台測試後才能決定要不要使用這個patch。

附帶一提backingStoreRatio已經被棄用

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

Successfully merging this pull request may close these issues.

2 participants