mirror of
https://github.com/klxf/eext-jiepei-helper.git
synced 2025-12-07 22:54:13 +08:00
Fix board size precision
This commit is contained in:
@@ -251,6 +251,7 @@
|
||||
class="w-16 p-1 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm"
|
||||
id="BoardWidth"
|
||||
type="number"
|
||||
step="0.01"
|
||||
value="10"
|
||||
/>
|
||||
<span class="text-gray-700">CM × 宽(y)</span>
|
||||
@@ -258,6 +259,7 @@
|
||||
class="w-16 p-1 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm"
|
||||
id="BoardHeight"
|
||||
type="number"
|
||||
step="0.01"
|
||||
value="10"
|
||||
/>
|
||||
<span class="text-gray-700">CM,数量</span>
|
||||
@@ -1532,8 +1534,8 @@
|
||||
const BBox = await eda.pcb_Primitive.getPrimitivesBBox([selectedPrimitives[0].getState_PrimitiveId()]);
|
||||
const boardHeight = eda.sys_Unit.milToMm(BBox.maxY - BBox.minY - 10) / 10;
|
||||
const boardWidth = eda.sys_Unit.milToMm(BBox.maxX - BBox.minX - 10) / 10;
|
||||
document.getElementById('BoardHeight').value = boardHeight;
|
||||
document.getElementById('BoardWidth').value = boardWidth;
|
||||
document.getElementById('BoardHeight').value = boardHeight.toFixed(2);
|
||||
document.getElementById('BoardWidth').value = boardWidth.toFixed(2);
|
||||
eda.sys_Message.showToastMessage('已自动识别板子大小', 'success');
|
||||
} else {
|
||||
eda.sys_Message.showToastMessage('所选图元非板框', 'error');
|
||||
|
||||
Reference in New Issue
Block a user