Skip to content
This repository has been archived by the owner on Jan 26, 2018. It is now read-only.

Border pixels now completely filled (no black outline) #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions scripts/render.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

//
// Mimic
// Made by 1lann and GravityScore
Expand Down Expand Up @@ -50,9 +49,26 @@ render.characterBackground = function(x, y, color, ctx) {
if (x >= 1 && y >= 1 && x <= computer.width && y <= computer.height) {
var cellX = ((x - 1) * config.cellWidth + config.borderWidth);
var cellY = ((y - 1) * config.cellHeight + config.borderHeight);
var cellHeight = config.cellHeight;
var cellWidth = config.cellWidth;
if(x == 1){
cellX = 0
cellWidth = config.cellWidth + config.borderWidth;
}
else if(x == computer.width){
cellWidth = config.cellWidth + config.borderWidth;
}

if(y == 1){
cellY = 0
cellHeight = config.cellHeight + config.borderHeight;
}
else if(y == computer.height){
cellHeight = config.cellHeight + config.borderHeight;
}

ctx.beginPath();
ctx.rect(cellX, cellY, config.cellWidth, config.cellHeight);
ctx.rect(cellX, cellY, cellWidth, cellHeight);
ctx.fillStyle = globals.colors[color];
ctx.fill();
}
Expand Down