restore x/y axis names

This commit is contained in:
Stewart Allen 2020-11-18 09:26:41 -05:00
commit b9c2fdf06a
4 changed files with 8 additions and 9 deletions

View file

@ -1,7 +1,6 @@
# Kiri:Moto todo
## 2.3 remaining
* fix ruler axis name label
## 2.4 tenative list
* cnc

View file

@ -1,6 +1,6 @@
{
"name": "grid-apps",
"version": "2.3.12.D",
"version": "2.3.13.D",
"description": "grid.space 3d slice & modeling tools",
"author": "Stewart Allen <sa@grid.space>",
"license": "MIT",

View file

@ -3,7 +3,7 @@
let terms = {
COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
LICENSE: "See the license.md file included with the source distribution",
VERSION: "2.3.D12"
VERSION: "2.3.D13"
};
if (typeof(module) === 'object') {

View file

@ -342,18 +342,18 @@
if (drawX) {
const xPadding = labelSize * 4;
const canvas = canvasInMesh(x + xPadding, labelSize, 'center', 'top', rulerColor);
const canvas = canvasInMesh(x + xPadding, labelSize * 3, 'center', 'top', rulerColor);
for (let i = rulerXFirst; i <= rulerXLast; i += gridUnitMajor) {
const label = ((offsetCenter ? i - (rulerXLast + rulerXFirst) / 2 : i) * factor).round(1);
canvas.ctx.fillText('' + label, i + xPadding / 2, 0);
}
canvas.mesh.position.set(0, - h - labelSize / 2 - 5, zp);
canvas.mesh.position.set(0, - h - labelSize * 2, zp);
rulersView.add(canvas.mesh);
if (axesOn && false) {
if (axesOn) {
canvas.ctx.font = (labelSize * 0.75) + 'px sans-serif';
canvas.ctx.fillText('X', rulerXFirst, labelSize * (1/8));
canvas.ctx.fillText('X', (x + xPadding)/2, labelSize * 1.5);
canvas.ctx.font = labelSize + 'px sans-serif';
}
}
@ -370,9 +370,9 @@
canvas.mesh.position.set(-w - labelSize * 2 - 5, 0, zp);
rulersView.add(canvas.mesh);
if (axesOn && false) {
if (axesOn) {
canvas.ctx.font = (labelSize * 0.75) + 'px sans-serif';
canvas.ctx.fillText('Y', labelSize * 3.5, y);
canvas.ctx.fillText('Y', labelSize*1.25, (y + yPadding)/2);
canvas.ctx.font = labelSize + 'px sans-serif';
}
}