refactor(network): Die Methode getAnnotationParams wurde aktualisiert, um die Anmerkung übersetzen und das Verhältnis ihrer Größe ändern zu können.

This commit is contained in:
Developer 02
2025-03-24 10:24:35 +01:00
parent eef6bf27f1
commit 9ae1efb946
3 changed files with 19 additions and 13 deletions

View File

@@ -204,10 +204,20 @@ async function logout() {
});
}
function getAnnotationParams() {
function getAnnotationParams(leftInInch = 0, topInInch = 0, inchToPointFactor = 72) {
return fetch(`${window.location.origin}/api/Config/Annotations`, {
credentials: 'include',
method: 'GET'
})
.then(res => res.json());
.then(res => res.json())
.then(annotParams => {
for(var key in annotParams){
var annot = annotParams[key];
annot.width *= inchToPointFactor;
annot.height *= inchToPointFactor;
annot.left = (leftInInch + annot.left) * inchToPointFactor - annot.width / 2;
annot.top = (topInInch + annot.top) * inchToPointFactor - annot.height / 2;
}
return annotParams;
});
}