fix: fix ExcludeObjectDialogMap for delta printers (#1217)

This commit is contained in:
Stefan Dej 2023-01-07 22:08:07 +01:00 committed by GitHub
parent c2ecc845ca
commit 034ff81e49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,7 @@ svg {
stroke-width="1" /> stroke-width="1" />
</g> </g>
<g v-for="(object, index) in printing_objects" :key="index"> <g v-for="(object, index) in printing_objects_with_polygons" :key="index">
<polygon <polygon
:points="object.polygon.map((point) => convertX(point[0]) + ',' + convertY(point[1])).join(' ')" :points="object.polygon.map((point) => convertX(point[0]) + ',' + convertY(point[1])).join(' ')"
style="cursor: pointer" style="cursor: pointer"
@ -124,6 +124,10 @@ export default class StatusPanelObjectsDialogMap extends Mixins(BaseMixin) {
return this.$store.state.printer.exclude_object?.objects ?? [] return this.$store.state.printer.exclude_object?.objects ?? []
} }
get printing_objects_with_polygons() {
return this.printing_objects.filter((eobject: any) => 'polygon' in eobject)
}
get current_object() { get current_object() {
return this.$store.state.printer.exclude_object?.current_object ?? null return this.$store.state.printer.exclude_object?.current_object ?? null
} }
@ -144,20 +148,32 @@ export default class StatusPanelObjectsDialogMap extends Mixins(BaseMixin) {
) )
} }
get toolhead() {
return this.$store.state.printer.toolhead ?? {}
}
get axis_minimum() {
return this.toolhead.axis_minimum ?? []
}
get axis_maximum() {
return this.toolhead.axis_maximum ?? []
}
get stepperXmin() { get stepperXmin() {
return this.$store.state.printer.configfile?.settings?.stepper_x?.position_min ?? 0 return this.axis_minimum[0] ?? 0
} }
get stepperXmax() { get stepperXmax() {
return this.$store.state.printer.configfile?.settings?.stepper_x?.position_max ?? 0 return this.axis_maximum[0] ?? 200
} }
get stepperYmin() { get stepperYmin() {
return this.$store.state.printer.configfile?.settings?.stepper_y?.position_min ?? 200 return this.axis_minimum[1] ?? 0
} }
get stepperYmax() { get stepperYmax() {
return this.$store.state.printer.configfile?.settings?.stepper_y?.position_max ?? 200 return this.axis_maximum[1] ?? 200
} }
get absoluteX() { get absoluteX() {