fixed annotation description placement

This commit is contained in:
Lasha Kapanadze 2025-08-25 19:59:22 +04:00
parent 1bda30e957
commit 1361340928

View File

@ -651,6 +651,21 @@ $(document).ready(function () {
// ტექსტი
ctx.fillStyle = "#111111";
partsList.forEach((part, index) => {
const domWidth = $("#samplePhoto").width();
const domHeight = $("#samplePhoto").height();
// NATURAL ზომა (ფაილის რეალური ზომა)
const naturalWidth = photoData.naturalWidth;
const naturalHeight = photoData.naturalHeight;
// მასშტაბები
const scaleX = naturalWidth / domWidth;
const scaleY = naturalHeight / domHeight;
// გადაყვანილი კოორდინატები
const x = descriptionPosition.x * scaleX;
const y = descriptionPosition.y * scaleY;
ctx.fillText(part, x + 15, y + 35 + index * textHeight);
});
}