Skip to content

Commit

Permalink
Merge pull request #19 from vokseverk/bugfix-floats-integers
Browse files Browse the repository at this point in the history
Bugfix: Fix problem with disappearing hotspot
  • Loading branch information
greystate committed Apr 17, 2024
2 parents 14be1e7 + ce8be87 commit 6f7af92
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/package.ent
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!ENTITY packageVersion "1.1.9">
<!ENTITY packageVersionV9 "2.0.0">
<!ENTITY packageVersionV10 "3.0.4">
<!ENTITY packageVersionV10 "3.0.5">
<!ENTITY packageVersionV11 "4.0.0">

<!ENTITY packageNamespace "Vokseverk">
Expand Down
11 changes: 7 additions & 4 deletions src/propeditor.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,16 @@ angular.module("umbraco").controller("ImageHotspotController", function($scope,
$scope.storePosition = function (x, y) {
$scope.assertImageDimensions()

var percentX = 100 * x / $scope.image.width
var percentY = 100 * y / $scope.image.height
var xInt = Math.round(x)
var yInt = Math.round(y)

var percentX = 100 * xInt / $scope.image.width
var percentY = 100 * yInt / $scope.image.height

$scope.model.value = {
image: $scope.image.src,
left: x,
top: y,
left: xInt,
top: yInt,
percentX: percentX,
percentY: percentY,
width: $scope.image.width,
Expand Down
2 changes: 2 additions & 0 deletions umbraco-marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"Url": "https://greystate.dk/who/"
},
"Category": "Editor Tools",
"LicenseTypes": [ "Free" ],
"PackageType": "Package",
"Screenshots": [
{
"ImageUrl": "https://raw.githubusercontent.com/vokseverk/Vokseverk.ImageHotspot/master/images/imagehotspot-editor.jpg",
Expand Down

0 comments on commit 6f7af92

Please sign in to comment.