Skip to content

Commit 05892ef

Browse files
committed
DM-10461: Fixed: wcs match a little off for almost north plots
1 parent a0d8ac1 commit 05892ef

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/firefly/js/visualize/CsysConverter.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,8 @@ export class CysConverter {
485485

486486
// convert image workspace to screen
487487
const zFact= this.zoomFactor;
488-
retPt.x= Math.floor(imageWorkspaceX*zFact);
489-
retPt.y= Math.floor((this.dataHeight - imageWorkspaceY) *zFact);
488+
retPt.x= imageWorkspaceX*zFact;
489+
retPt.y= (this.dataHeight - imageWorkspaceY) *zFact;
490490
}
491491

492492

@@ -499,8 +499,8 @@ export class CysConverter {
499499
makeSPtFromIWPt(iwpt, altZoomLevel) {
500500
if (!iwpt) return null;
501501
const zoom= altZoomLevel || this.zoomFactor;
502-
return makeScreenPt(Math.floor(iwpt.x*zoom),
503-
Math.floor((this.dataHeight - iwpt.y) *zoom) );
502+
return makeScreenPt(iwpt.x*zoom,
503+
(this.dataHeight - iwpt.y) *zoom );
504504
}
505505

506506

src/firefly/js/visualize/task/WcsMatchTask.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,9 @@ function rotateToMatch(pv, masterPv, flipY) {
187187
const masterPlot= primePlot(masterPv);
188188
if (!plot) return;
189189
const masterRot= masterPv.rotation * (flipY ? -1 : 1);
190-
const targetRotation= ((getRotationAngle(masterPlot)+ masterRot) -
190+
var targetRotation= ((getRotationAngle(masterPlot)+ masterRot) -
191191
(getRotationAngle(plot))) * (flipY ? 1 : -1);
192+
if (targetRotation<0) targetRotation+= 360;
192193
dispatchRotate({
193194
plotId: plot.plotId,
194195
rotateType: RotateType.ANGLE,

0 commit comments

Comments
 (0)