Merge branch 'blending' into master_v2

This commit is contained in:
ljqing 2023-02-15 19:42:09 +08:00
commit 1bfb5af0a5
1 changed files with 12 additions and 12 deletions

View File

@ -55,7 +55,7 @@
<div class="col-2"> <q-select class="q-pt-md" :label="$t('vertical')"
@update:model-value="(val) => { options_v = val }" :dense="true" filled v-model="options_model_v"
:options="options_v" emit-value map-options /></div>
<div class="col-2"> <q-input filled type="number" class="q-pt-md" :dense="true"
<div class="col-2"> <q-input v-if="value_v[options_model_v]" filled type="number" class="q-pt-md" :dense="true"
v-model="value_v[options_model_v].y" @update:model-value="chang(options_model_v, $event, 'v')" lazy-rules />
</div>
<div class="q-pt-md col-2">
@ -75,7 +75,7 @@
<div class="col-2"> <q-select class="q-pt-md" :label="$t('level')"
@update:model-value="(val) => { options_h = val }" :dense="true" filled v-model="options_model_h"
:options="options_h" emit-value map-options /></div>
<div class="col-2"> <q-input filled type="number" class="q-pt-md" :dense="true"
<div class="col-2"> <q-input v-if="value_h[options_model_h]" filled type="number" class="q-pt-md" :dense="true"
v-model="value_h[options_model_h].x" @update:model-value="chang(options_model_h, $event, 'h')" lazy-rules />
</div>
<div class="q-pt-md col-2">
@ -391,17 +391,17 @@ export default defineComponent({
save_set_cache()
}
const chang = (index: number, $event: any, type: string) => {
const chang = (index: number, $event: any, type: string, send: boolean) => {
$event = Number($event)
if (type == 'v') {
let tmp = coordinate_transformation_value_to_xy(0, $event)
value_v_point.value[index].y = Math.trunc(tmp.y)
send_value(index, type, Math.trunc(value_v.value[index].y))
send_value(index, type, Math.trunc(value_v.value[index].y), send)
}
if (type == 'h') {
let tmp = coordinate_transformation_value_to_xy($event, 0)
value_h_point.value[index].x = Math.trunc(tmp.x)
send_value(index, type, Math.trunc(value_h.value[index].x))
send_value(index, type, Math.trunc(value_h.value[index].x), send)
}
save_set_cache()
}
@ -531,16 +531,17 @@ export default defineComponent({
if (type == 'v') {
value_v.value[index].x = value_v.value[index].def_x
value_v.value[index].y = value_v.value[index].def_y
chang(index, value_v.value[index].def_y, type)
chang(index, value_v.value[index].def_y, type, send)
}
if (type == 'h') {
value_h.value[index].x = value_h.value[index].def_x
value_h.value[index].y = value_h.value[index].def_y
chang(index, value_h.value[index].def_x, type)
chang(index, value_h.value[index].def_x, type, send)
}
save_set_cache()
}
const send_value = (index: number, type: string, value: number) => {
const send_value = (index: number, type: string, value: number, send: boolean = true) => {
if (!send) return;
let row = $store.getters.GetTheCurrentlySelectedCamera[0]
let col = $store.getters.GetTheCurrentlySelectedCamera[1]
if (type == 'v') {
@ -554,19 +555,18 @@ export default defineComponent({
switch (now_v_h.value) {
case 'vertical':
for (let index = 0; index < value_v_point_amount.value; index++) {
reset(index, true, 'v')
reset(index, false, 'v')
}
break;
case 'level':
for (let index = 0; index < value_h_point_amount.value; index++) {
reset(index, true, 'h')
reset(index, false, 'h')
}
break;
default:
break;
}
send_value(-2, 'v', 0);
}
const del_dialog = ref(false)
const add_control_points = (amount: number, type: string) => {