fixed annotation description placement
This commit is contained in:
@@ -651,6 +651,21 @@ $(document).ready(function () {
|
|||||||
// ტექსტი
|
// ტექსტი
|
||||||
ctx.fillStyle = "#111111";
|
ctx.fillStyle = "#111111";
|
||||||
partsList.forEach((part, index) => {
|
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);
|
ctx.fillText(part, x + 15, y + 35 + index * textHeight);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user