Prevent unnecessary marker repositioning on world change

This commit is contained in:
James Lyne 2021-07-27 02:28:01 +01:00
parent 0aa61517dc
commit d37657d3e2
4 changed files with 8 additions and 12 deletions

View File

@ -101,9 +101,8 @@ export default defineComponent({
} }
}; };
//FIXME: Prevent unnecessary repositioning when changing worlds watch(currentMap, (newValue, oldValue) => {
watch(currentMap, (newValue) => { if(newValue && (!oldValue || oldValue.world === newValue.world)) {
if(newValue) {
const converter = getPointConverter(); const converter = getPointConverter();
for (const [id, area] of props.set.areas) { for (const [id, area] of props.set.areas) {

View File

@ -101,9 +101,8 @@ export default defineComponent({
} }
}; };
//FIXME: Prevent unnecessary repositioning when changing worlds watch(currentMap, (newValue, oldValue) => {
watch(currentMap, (newValue) => { if(newValue && (!oldValue || oldValue.world === newValue.world)) {
if(newValue) {
const converter = getPointConverter(); const converter = getPointConverter();
for (const [id, circle] of props.set.circles) { for (const [id, circle] of props.set.circles) {

View File

@ -100,9 +100,8 @@ export default defineComponent({
} }
}; };
//FIXME: Prevent unnecessary repositioning when changing worlds watch(currentMap, (newValue, oldValue) => {
watch(currentMap, (newValue) => { if(newValue && (!oldValue || oldValue.world === newValue.world)) {
if(newValue) {
const converter = getPointConverter(); const converter = getPointConverter();
for (const [id, line] of props.set.lines) { for (const [id, line] of props.set.lines) {

View File

@ -100,9 +100,8 @@ export default defineComponent({
} }
}; };
//FIXME: Prevent unnecessary repositioning when changing worlds watch(currentMap, (newValue, oldValue) => {
watch(currentMap, (newValue) => { if(newValue && (!oldValue || oldValue.world === newValue.world)) {
if(newValue) {
for (const [id, marker] of props.set.markers) { for (const [id, marker] of props.set.markers) {
updateMarker(layers.get(id), marker, getPointConverter()); updateMarker(layers.get(id), marker, getPointConverter());
} }