Skip to content

Commit

Permalink
handle unexpected attr panel event
Browse files Browse the repository at this point in the history
  • Loading branch information
RayPS committed Nov 11, 2024
1 parent 5e07c73 commit 364cf01
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extension/util-create-rounded-rectangle.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ class RoundRect extends Component {
})

$('#attr-main').on("change", () => {
const unit = $('#attr-main select[name="attr-pcbcanvas-unit"]').val() == "mil" ? "mil" : "mm";
const unsafe_unitVal = $('#attr-main select[name="attr-pcbcanvas-unit"]').val()
if (!unsafe_unitVal) return
const unit = unsafe_unitVal == "mil" ? "mil" : "mm";
const convert = (value) => parseFloat(api('unitConvert', { type: unit == 'mil' ? 'mm2mil' : 'mil2mm', value }).toFixed(3))
if (unit !== this.state.unit) {
this.setState({
Expand Down

0 comments on commit 364cf01

Please sign in to comment.