|
@@ -46,7 +46,7 @@ function SingleImageView(option) {
|
|
SingleImageView.prototype.init = function () {
|
|
SingleImageView.prototype.init = function () {
|
|
var self = this;
|
|
var self = this;
|
|
this.container = getDom(this.container_dom, this.markControl).appendTo(this.markControl.container.centerContent);
|
|
this.container = getDom(this.container_dom, this.markControl).appendTo(this.markControl.container.centerContent);
|
|
- this.container.height(this.markControl.container.centerContent.height()-20);
|
|
|
|
|
|
+ this.container.height(this.markControl.container.centerContent.height() - 20);
|
|
//this.container.perfectScrollbar({
|
|
//this.container.perfectScrollbar({
|
|
// wheelSpeed: 20
|
|
// wheelSpeed: 20
|
|
//});
|
|
//});
|
|
@@ -59,11 +59,11 @@ SingleImageView.prototype.init = function () {
|
|
|
|
|
|
$(this.canvas).click(function (event) {
|
|
$(this.canvas).click(function (event) {
|
|
if (self.task != undefined) {
|
|
if (self.task != undefined) {
|
|
- let scale = self.image.width / self.canvas.width
|
|
|
|
|
|
+ let scale = self.image.width / self.canvas.width
|
|
let left = event.pageX - $(self.canvas).offset().left
|
|
let left = event.pageX - $(self.canvas).offset().left
|
|
let top = event.pageY - $(self.canvas).offset().top
|
|
let top = event.pageY - $(self.canvas).offset().top
|
|
- let offsetX = left*scale
|
|
|
|
- let offsetY = top*scale
|
|
|
|
|
|
+ let offsetX = left * scale
|
|
|
|
+ let offsetY = top * scale
|
|
let offsetIndex = 1
|
|
let offsetIndex = 1
|
|
for (let i = 0; i < self.task.imageLayout.length; i++) {
|
|
for (let i = 0; i < self.task.imageLayout.length; i++) {
|
|
let layout = self.task.imageLayout[i]
|
|
let layout = self.task.imageLayout[i]
|
|
@@ -140,7 +140,7 @@ SingleImageView.prototype.reloadImage = function (scaleAddon) {
|
|
|
|
|
|
SingleImageView.prototype.drawTag = function (tag) {
|
|
SingleImageView.prototype.drawTag = function (tag) {
|
|
if (tag != undefined && tag.positionX > 0 && tag.positionY > 0 && this.image != undefined) {
|
|
if (tag != undefined && tag.positionX > 0 && tag.positionY > 0 && this.image != undefined) {
|
|
- this.ctx.font = parseInt(60 * this.scale) + "px Arial";
|
|
|
|
|
|
+ this.ctx.font = parseInt(30 * this.scale) + "px Arial";
|
|
this.ctx.fillStyle = 'red';
|
|
this.ctx.fillStyle = 'red';
|
|
this.ctx.fillText(tag.content, tag.positionX * this.canvas.width, tag.positionY * this.canvas.height);
|
|
this.ctx.fillText(tag.content, tag.positionX * this.canvas.width, tag.positionY * this.canvas.height);
|
|
}
|
|
}
|