Skip to content

Commit

Permalink
13:00 to 15:00, fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans5958 committed Jul 20, 2023
1 parent 61ac3c8 commit 563dd18
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 11 deletions.
Binary file modified web/_img/canvas/main-ex/start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/_img/canvas/main/1689859449.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/_img/canvas/main/1689861680.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/_img/canvas/main/1689863453.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/_img/canvas/main/1689865041.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/_img/canvas/main/1689865307.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 10 additions & 6 deletions web/_js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ window.pageTitle = pageTitle

const canvasSize = {
x: 1000,
y: 1000
y: 2000
}
window.canvasSize = canvasSize

const canvasOffset = {
x: -500,
y: -500
y: -1000
}
window.canvasOffset = canvasOffset

Expand All @@ -39,14 +39,18 @@ const variationsConfig = {
default: {
name: "r/place",
code: "",
default: 0,
drawablePeriods: [0, 0],
default: 4,
drawablePeriods: [1, 4],
drawableRegions: [
[[0, 0], [-500, -500, 499, 499]],
[[0, 4], [-500, -500, 499, 499]],
],
// expansions: [],
versions: [
{ "timestamp": 1689832800, "url": ["./_img/canvas/main-ex/start.png"] },
{ "timestamp": 1689858000, "url": ["./_img/canvas/main-ex/start.png"] },
{ "timestamp": 1689859449, "url": ["./_img/canvas/main/1689859449.png"] },
{ "timestamp": 1689861680, "url": ["./_img/canvas/main/1689861680.png"] },
{ "timestamp": 1689863453, "url": ["./_img/canvas/main/1689863453.png"] },
{ "timestamp": 1689865307, "url": ["./_img/canvas/main/1689865307.png"] },
],
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 192 192" aria-hidden="true"><polygon points="154 0 154 38 39 38 39 192 0 192 0 0"/><polygon points="192 38 192 192 77 192 77 153 154 153 154 38"/><rect x="77" y="77" width="38" height="38"/></svg>'
},
Expand Down
4 changes: 2 additions & 2 deletions web/_js/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ function applyView() {

zoomOrigin = [scaleZoomOrigin[0] * zoom, scaleZoomOrigin[1] * zoom]

innerContainer.style.height = (~~(zoom * canvasSize.x)) + "px"
innerContainer.style.width = (~~(zoom * canvasSize.y)) + "px"
innerContainer.style.width = (~~(zoom * canvasSize.x)) + "px"
innerContainer.style.height = (~~(zoom * canvasSize.y)) + "px"

innerContainer.style.left = ~~(container.clientWidth / 2 - innerContainer.clientWidth / 2 + zoomOrigin[0] + container.offsetLeft) + "px"
innerContainer.style.top = ~~(container.clientHeight / 2 - innerContainer.clientHeight / 2 + zoomOrigin[1] + container.offsetTop) + "px"
Expand Down
6 changes: 3 additions & 3 deletions web/_js/main/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ async function render() {

if (path[0]) {
//context.moveTo(path[0][0]*zoom, path[0][1]*zoom)
highlightContext.moveTo(path[0][0] - canvasOffset.x, path[0][1]- canvasOffset.y)
highlightContext.moveTo(path[0][0] - canvasOffset.x, path[0][1] - canvasOffset.y)
}

for (let p = 1; p < path.length; p++) {
Expand Down Expand Up @@ -547,12 +547,12 @@ async function render() {

if (path[0]) {
//context.moveTo(path[0][0]*zoom, path[0][1]*zoom)
highlightContext.moveTo(path[0][0], path[0][1])
highlightContext.moveTo(path[0][0] - canvasOffset.x, path[0][1] - canvasOffset.y)
}

for (let p = 1; p < path.length; p++) {
//context.lineTo(path[p][0]*zoom, path[p][1]*zoom)
highlightContext.lineTo(path[p][0], path[p][1])
highlightContext.lineTo(path[p][0] - canvasOffset.x, path[p][1] - canvasOffset.y)
}

highlightContext.closePath()
Expand Down

0 comments on commit 563dd18

Please sign in to comment.