Skip to content

Commit 8e99c26

Browse files
committed
Release 1.0.4
1 parent 7e31ef7 commit 8e99c26

File tree

16 files changed

+88
-24
lines changed

16 files changed

+88
-24
lines changed

release/asset-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"main.css": "static/css/main.0a762989.css",
33
"main.css.map": "static/css/main.0a762989.css.map",
4-
"main.js": "static/js/main.d382308c.js",
5-
"main.js.map": "static/js/main.d382308c.js.map",
6-
"static\\media\\logo.svg": "static/media/logo.5d5d9eef.svg"
4+
"main.js": "static/js/main.60b68519.js",
5+
"main.js.map": "static/js/main.60b68519.js.map",
6+
"static\\media\\logo.svg": "static/media/logo.ee7cd8ed.svg"
77
}

release/component/component.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ function Initialize()
148148
{
149149
graph.FromJson(ME, JSON.parse(json));
150150
}
151-
cursor_default.src = url + "component/cursor/default.png";
152-
cursor_move.src = url + "component/cursor/move.png";
151+
cursor_default.src = "/bench/component/cursor/default.png";
152+
cursor_move.src = "/bench/component/cursor/move.png";
153153
}
154154
function _event_onKeyPress(event)
155155
{
@@ -400,6 +400,14 @@ function _event_onNavigationSelect(event)
400400
{
401401
window.dispatchEvent(new CustomEvent("_event_onSignalFloors", { detail: { floor: RenderedFloor, floors: graph.Floors } }));
402402
}
403+
else if (navigation === "_navigation_view_floordown")
404+
{
405+
_event_onSignalFloorChange({ detail: { floor: RenderedFloor - 1 } });
406+
}
407+
else if (navigation === "_navigation_view_floorup")
408+
{
409+
_event_onSignalFloorChange({ detail: { floor: RenderedFloor + 1 } });
410+
}
403411
}
404412
function _event_onMouseDown(event)
405413
{
@@ -447,7 +455,7 @@ function _event_onMouseMove(event)
447455
for (let i = 0; i < graph.Nodes.length; i++)
448456
{
449457
let child = graph.Nodes[i];
450-
if (child.ProjectedLocation.DistanceTo(new Vertex(MousePosition.X, MousePosition.Y, 0)) < 10)
458+
if (graph.DistanceToNode(i, new Vertex(MousePosition.X, MousePosition.Y, 0)) < 10)
451459
{
452460
graph.Nodes[i].Hovered = true;
453461
}
@@ -581,7 +589,6 @@ function _event_onInjectChange(event)
581589
}
582590
function _event_onSignalFloorChange(event)
583591
{
584-
console.log(event.detail.floor);
585592
RenderedFloor = parseFloat(event.detail.floor);
586593
graph.RenderedFloor = parseFloat(event.detail.floor);
587594
UpdateURL();

release/component/element.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,24 @@ let Graph = class Graph
113113
return false;
114114
}
115115
}
116+
DistanceToNode(i, point)
117+
{
118+
if (this.NodeInFloor(this.Nodes[i]))
119+
{
120+
if (this.Nodes[i].ProjectedLocation)
121+
{
122+
return this.Nodes[i].ProjectedLocation.DistanceTo(point);
123+
}
124+
else
125+
{
126+
return Number.MAX_SAFE_INTEGER;
127+
}
128+
}
129+
else
130+
{
131+
return Number.MAX_SAFE_INTEGER;
132+
}
133+
}
116134
Render(ME, z_rotation)
117135
{
118136
for (let i = 0; i < this.Elements.length; i++)
@@ -158,11 +176,11 @@ let Graph = class Graph
158176
}
159177
for (let i = 0; i < this.Nodes.length; i++)
160178
{
179+
let p = ME.ProjectVertex(this.Nodes[i].Location, z_rotation);
180+
this.Nodes[i].ProjectedLocation = new Vertex(p.X, p.Y, p.Z);
161181
if (this.NodeInFloor(this.Nodes[i]))
162182
{
163183
ME.Device2D.beginPath();
164-
let p = ME.ProjectVertex(this.Nodes[i].Location, z_rotation);
165-
this.Nodes[i].ProjectedLocation = new Vertex(p.X, p.Y, p.Z);
166184
ME.Device2D.arc(p.X, p.Y, 5, 0, Math.PI * 2, true);
167185
let selected = false;
168186
let style = "#000000";

release/component/engine.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ var Engine = class Engine
105105
this.RenderingCanvas.height = parseInt(style.height);
106106
this.Device.viewportWidth = canvas.width;
107107
this.Device.viewportHeight = canvas.height;
108-
this.Shader_Vertex = this.LoadShaderFile("/component/shader.MSV");
109-
this.Shader_Pixel = this.LoadShaderFile("/component/shader.MSP");
108+
this.Shader_Vertex = this.LoadShaderFile("/bench/component/shader.MSV");
109+
this.Shader_Pixel = this.LoadShaderFile("/bench/component/shader.MSP");
110110
this.Shader_Program = this.Device.createProgram();
111111
this.Device.attachShader(this.Shader_Program, this.Shader_Vertex);
112112
this.Device.attachShader(this.Shader_Program, this.Shader_Pixel);

release/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"><title>Graph Workbench</title><link href="/static/css/main.0a762989.css" rel="stylesheet"></head><body onload="Main()"><noscript>Wow, such empty!</noscript><div id="main"></div><script type="text/javascript" src="webgl/helper.js"></script><script type="text/javascript" src="webgl/utilities.js"></script><script type="text/javascript" src="component/engine.js"></script><script type="text/javascript" src="component/component.js"></script><script type="text/javascript" src="component/element.js"></script><script type="text/javascript" src="/static/js/main.d382308c.js"></script></body></html>
1+
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"><title>Graph Workbench</title><link href="/bench/static/css/main.0a762989.css" rel="stylesheet"></head><body onload="Main()"><noscript>Wow, such empty!</noscript><div id="main"></div><script type="text/javascript" src="webgl/helper.js"></script><script type="text/javascript" src="webgl/utilities.js"></script><script type="text/javascript" src="component/engine.js"></script><script type="text/javascript" src="component/component.js"></script><script type="text/javascript" src="component/element.js"></script><script type="text/javascript" src="/bench/static/js/main.60b68519.js"></script></body></html>

release/service-worker.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/static/css/main.0a762989.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/static/js/main.60b68519.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/static/js/main.60b68519.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/static/js/main.d382308c.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)