iconlaunch - Go back to now faster drawImage

pull/2895/head
Martin Boonk 2023-07-25 19:55:18 +02:00
parent b6459ad26a
commit 7e0dbbf6f0
1 changed files with 1 additions and 4 deletions

View File

@ -57,19 +57,17 @@
c.icondata = ICON_MISSING;
count++;
}
let drawItem = function(itemI, r) {
let x = 0;
let apps = launchCache.items[itemI];
let i = itemI * appsN - 1;
let selectedApp;
let currentApp;
let layers=[];
let selectedRect;
for (currentApp of apps) {
i++;
x += whitespace;
layers.push({x:x+r.x,y:r.y + iconYoffset,image:currentApp.icondata});
g.drawImage(currentApp.icondata,x + r.x - 1, r.y + iconYoffset - 1, x + r.x + iconSize, r.y + iconYoffset + iconSize);
if (selectedItem == i) {
selectedApp = currentApp;
selectedRect = [
@ -82,7 +80,6 @@
x += iconSize;
}
if (selectedRect) g.clearRect(r.x, r.y, r.x + r.w - 1, r.y + r.h - 1);
g.drawImages(layers);
if (selectedRect) g.drawRect.apply(null, selectedRect);
if (selectedApp) drawText(itemI, r.y, selectedApp);
};