Skip to content

Commit

Permalink
export fix, highlight code simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
arttu76 committed Dec 3, 2023
1 parent f53859f commit 831fc91
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/components/Screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,18 +226,25 @@ export const Screen = () => {
? spectrumColor.bright
: spectrumColor.normal;

renderedPixel = highlightMatch
? getMaskColor()
: pixel
? normalOrBrightColors[attribute.ink]
: normalOrBrightColors[attribute.paper]
renderedPixel = pixel
? normalOrBrightColors[attribute.ink]
: normalOrBrightColors[attribute.paper];

setSpectrumMemoryPixel(win[Keys.spectrumMemoryBitmap], x, y, !!pixel);
if (x % 8 === 0 && y % 8 === 0) {
setSpectrumMemoryAttribute(win[Keys.spectrumMemoryAttribute], x, y, attribute);
}
}

if (!renderedPixel) {
const bg = getBackgroundValue(x, y);
renderedPixel = [bg, bg, bg];
}

if (highlightMatch) {
renderedPixel = getMaskColor();
}

const offset = (y * 256 + x) * 4;
if (miniMapCtx && miniMapImageData) {
miniMapImageData.data[offset] = renderedPixel[0];
Expand Down

0 comments on commit 831fc91

Please sign in to comment.