Skip to content

Commit

Permalink
Move the description from above to below the floor plan, as Coby requ…
Browse files Browse the repository at this point in the history
…ested months ago.
  • Loading branch information
MarkNahabedian committed Feb 13, 2024
1 parent 61ff0b9 commit d819a9d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Facilities/HobbyShop-N51/floor_plan.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@

<h1>Hobby Shop Floor Plan (N51)</h1>
<div>
<div id="description"></div>
<div class="pointer-position">
X: <span id="show-pointer-x"></span>,
Y: <span id="show-pointer-y"></span>
</div>
<!--
We use object instead of img so that code in placement.js can
get access to the loaded SVG document.
Expand All @@ -49,6 +44,11 @@ <h1>Hobby Shop Floor Plan (N51)</h1>
machines, furnature, tools, etc.">
The Hobby Shop floor plan should appear here.
</object>
<div class="pointer-position">
X: <span id="show-pointer-x"></span>,
Y: <span id="show-pointer-y"></span>
</div>
<div id="description"></div>
</div>
<div id="controls">
<a id="download_floor_plan"
Expand Down
5 changes: 5 additions & 0 deletions placement.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,12 @@ function target(item, doit=false) {
c.setAttribute("r", radius);
overlay.appendChild(c);
let anchorX = window.scrollX + ((desc_bbox.left + desc_bbox.right) / 2);
// Is the description element above or below the floor_plan_svg
// element on the web page?
let anchorY = window.scrollY + desc_bbox.bottom;
if (desc_bbox.top > obj_bbox.bottom) {
anchorY = window.scrollY + desc_bbox.top;
}
let cpp = circle_perimeter_point(centerX, centerY, radius, anchorX, anchorY)
let p = document.createElementNS(overlay.namespaceURI, "path");
p.setAttribute("d",
Expand Down

0 comments on commit d819a9d

Please sign in to comment.