1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

fixing tests

This commit is contained in:
Patrik J. Braun 2019-07-19 15:45:37 +02:00
parent 88b432b634
commit 4cb36ad878

View File

@ -209,10 +209,10 @@ export class MetadataLoader {
} }
const name = region.attributes['mwg-rs:Name']; const name = region.attributes['mwg-rs:Name'];
const box = { const box = {
width: Math.round(parseInt('' + regionBox['stArea:w'], 10) * metadata.size.width), width: Math.round(parseFloat('' + regionBox['stArea:w']) * metadata.size.width),
height: Math.round(parseInt('' + regionBox['stArea:h'], 10) * metadata.size.height), height: Math.round(parseFloat('' + regionBox['stArea:h']) * metadata.size.height),
left: Math.round(parseInt('' + regionBox['stArea:x'], 10) * metadata.size.width), left: Math.round(parseFloat('' + regionBox['stArea:x']) * metadata.size.width),
top: Math.round(parseInt('' + regionBox['stArea:y'], 10) * metadata.size.height) top: Math.round(parseFloat('' + regionBox['stArea:y']) * metadata.size.height)
}; };
// convert center base box to corner based box // convert center base box to corner based box
box.left = Math.max(0, box.left - box.width / 2); box.left = Math.max(0, box.left - box.width / 2);