Skip to content

Commit

Permalink
Bug fix and changed lamp outline
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxAve committed Dec 12, 2024
1 parent addc25b commit b3e1488
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ canvas.addEventListener('mousedown', (event) => {
}/* else if(currentCursorMode == 1) {
deleteObject(key)
}*/
} else if(obj.type == SWITCH && mouseX < toScreenX(obj.position.x - cellSize * 3) /*&& mouseX > toScreenX(obj.position.x - rightSideLen * 2 - gapLen)*/ && mouseY > toScreenY(obj.position.y - cellSize * 3) && mouseY < toScreenY(obj.position.y + cellSize / 2)/*getDistance(toScreenX(obj.position.x - rightSideLen - gapLen / 2), toScreenY(obj.position.y), mouseX, mouseY) < cellSize * 3*/) {
} else if(obj.type == SWITCH && mouseX < toScreenX(obj.position.x - cellSize * 3) && mouseX > toScreenX(obj.position.x - rightSideLen * 2 - gapLen - cellSize) && mouseY > toScreenY(obj.position.y - cellSize * 3) && mouseY < toScreenY(obj.position.y + cellSize / 2)/*getDistance(toScreenX(obj.position.x - rightSideLen - gapLen / 2), toScreenY(obj.position.y), mouseX, mouseY) < cellSize * 3*/) {
if(currentCursorMode == 0) {
draggedObjectID = key
draggedObjectMouseDiff.x = obj.position.x - mouseX
Expand Down Expand Up @@ -1051,7 +1051,7 @@ function drawObject(id) {
if(id == draggedObjectID && !connectingWires) {
ctx.strokeStyle = selectedColorScheme.dragOutline
} else {
ctx.strokeStyle = selectedColorScheme.outline
ctx.strokeStyle = selectedColorScheme.wireOffColor
}
ctx.stroke()
drawLine(toScreenX(obj.position.x - Math.cos(0.7854) * cellSize * 1.5), toScreenY(obj.position.y - Math.cos(0.7854) * cellSize * 1.5), toScreenX(obj.position.x + Math.cos(0.7854) * cellSize * 1.5), toScreenY(obj.position.y + Math.cos(0.7854) * cellSize * 1.5))
Expand Down

0 comments on commit b3e1488

Please sign in to comment.