mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	fix screenshot scaling issue on firefox, https://github.com/zadam/trilium/issues/1202
This commit is contained in:
		| @@ -37,12 +37,7 @@ function cropImage(newArea, dataUrl) { | |||||||
|  |  | ||||||
| async function takeScreenshot(cropRect) { | async function takeScreenshot(cropRect) { | ||||||
| 	const activeTab = await getActiveTab(); | 	const activeTab = await getActiveTab(); | ||||||
|  | 	const zoom = await browser.tabs.getZoom(activeTab.id) *  window.devicePixelRatio; | ||||||
| 	const isFirefox = typeof InstallTrigger !== 'undefined'; |  | ||||||
|  |  | ||||||
| 	// Chrome/blink do not incorporate automatically the devicePixelRatio so we need to do it manually |  | ||||||
| 	const zoom = await browser.tabs.getZoom(activeTab.id) |  | ||||||
| 		* (isFirefox ? 1 : window.devicePixelRatio); |  | ||||||
|  |  | ||||||
| 	const newArea = Object.assign({}, cropRect); | 	const newArea = Object.assign({}, cropRect); | ||||||
| 	newArea.x *= zoom; | 	newArea.x *= zoom; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user