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) => {
if(newValue) {
watch(currentMap, (newValue, oldValue) => {
if(newValue && (!oldValue || oldValue.world === newValue.world)) {
const converter = getPointConverter();
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) => {
if(newValue) {
watch(currentMap, (newValue, oldValue) => {
if(newValue && (!oldValue || oldValue.world === newValue.world)) {
const converter = getPointConverter();
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) => {
if(newValue) {
watch(currentMap, (newValue, oldValue) => {
if(newValue && (!oldValue || oldValue.world === newValue.world)) {
const converter = getPointConverter();
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) => {
if(newValue) {
watch(currentMap, (newValue, oldValue) => {
if(newValue && (!oldValue || oldValue.world === newValue.world)) {
for (const [id, marker] of props.set.markers) {
updateMarker(layers.get(id), marker, getPointConverter());
}