Skip to content

Commit

Permalink
apply review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mki-c2c committed Oct 28, 2024
1 parent f07c95f commit 79fb70d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/components/draw/feature-edit-style-point.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ const popupOpen: Ref<boolean> = inject('popupOpen')!
<slot name="color"></slot>
<slot name="symbole"></slot>
<slot name="size" :maxsize="900"></slot>
<slot name="angle" :maxsize="900"></slot>
<slot name="angle"></slot>
</template>
</template>
17 changes: 8 additions & 9 deletions src/components/draw/feature-edit-style.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,23 @@ function onColorSelect(colorEvent: Event) {
feature.changed()
}
function onSizeChange(newSize: string | number) {
feature.featureStyle.size = parseFloat(newSize as string)
function onSizeChange(newSize: number) {
feature.featureStyle.size = newSize
feature.changed()
}
function onAngleChange(newAngle: string | number) {
feature.featureStyle.angle = (parseFloat(newAngle as string) * Math.PI) / 180
function onAngleChange(newAngle: number) {
feature.featureStyle.angle = (newAngle * Math.PI) / 180
feature.changed()
}
function onWidthChange(newWidth: string | number) {
feature.featureStyle.stroke = parseFloat(newWidth as string)
function onWidthChange(newWidth: number) {
feature.featureStyle.stroke = newWidth
feature.changed()
}
function onTransparencyChange(newTransparency: string | number) {
feature.featureStyle.opacity =
(100 - parseFloat(newTransparency as string)) / 100
function onTransparencyChange(newTransparency: number) {
feature.featureStyle.opacity = (100 - newTransparency) / 100
feature.changed()
}
Expand Down
5 changes: 1 addition & 4 deletions src/components/draw/feature-item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const props = withDefaults(
}
)
// should preform deep copy, nut then the updqte of the OL object on the canvas would not work ??
const localFeature = props.feature
const emit = defineEmits([
Expand Down Expand Up @@ -51,13 +50,11 @@ function onClickDelete() {
function onResetInfo(prevLabel: string, prevDescription: string) {
localFeature.label = prevLabel
localFeature.description = prevDescription
// emit('submitFeature', localFeature)
}
function onResetStyle(prevStyle: DrawnFeatureStyle) {
localFeature.featureStyle = Object.assign({}, prevStyle)
localFeature.featureStyle = { ...prevStyle }
localFeature.changed()
// emit('submitFeature', localFeature)
}
function onSubmitEditFeature() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/draw/feature-sub-content.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const feature: DrawnFeature = inject('feature')!
let prevLabel = feature.label
let prevDescription = feature.description
// keep deep copy of previous style to be able to revert style on cancel
const prevStyle: DrawnFeatureStyle = Object.assign({}, feature.featureStyle)
const prevStyle: DrawnFeatureStyle = { ...feature.featureStyle }
const editComponents = {
FeatureConcentricCircle,
Expand Down

0 comments on commit 79fb70d

Please sign in to comment.