fixed annotation description placement
This commit is contained in:
parent
1bda30e957
commit
1361340928
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user