mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 14:16:39 +01:00
Try willReadFrequently
This commit is contained in:
parent
fea1d77342
commit
696a46311d
2 changed files with 6 additions and 2 deletions
|
@ -188,7 +188,9 @@ function AccountInfo({
|
|||
try {
|
||||
// Get color from four corners of image
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
const ctx = canvas.getContext('2d', {
|
||||
willReadFrequently: true,
|
||||
});
|
||||
canvas.width = e.target.width;
|
||||
canvas.height = e.target.height;
|
||||
ctx.drawImage(e.target, 0, 0);
|
||||
|
|
|
@ -16,7 +16,9 @@ const alphaCache = {};
|
|||
const canvas = window.OffscreenCanvas
|
||||
? new OffscreenCanvas(1, 1)
|
||||
: document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
const ctx = canvas.getContext('2d', {
|
||||
willReadFrequently: true,
|
||||
});
|
||||
|
||||
function Avatar({ url, size, alt = '', squircle, ...props }) {
|
||||
size = SIZES[size] || size || SIZES.m;
|
||||
|
|
Loading…
Reference in a new issue