Skip to content

Commit b4b2aae

Browse files
committed
turn off optimisation in Microsoft Visual Studio for TextlineProjection::TruncateToImageBounds#pragma optimize( "", on )
fix issue 1496
1 parent f7fd63e commit b4b2aae

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

textord/textlineprojection.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -751,11 +751,17 @@ void TextlineProjection::TransformToPixCoords(const DENORM* denorm,
751751
pt->y = ImageYToProjectionY(pt->y);
752752
}
753753

754+
#ifdef _MSC_VER
755+
#pragma optimize("g", off)
756+
#endif // _MSC_VER
754757
// Helper truncates the TPOINT to be within the pix_.
755758
void TextlineProjection::TruncateToImageBounds(TPOINT* pt) const {
756759
pt->x = ClipToRange<int>(pt->x, 0, pixGetWidth(pix_) - 1);
757760
pt->y = ClipToRange<int>(pt->y, 0, pixGetHeight(pix_) - 1);
758761
}
762+
#ifdef _MSC_VER
763+
#pragma optimize( "", on )
764+
#endif // _MSC_VER
759765

760766
// Transform tesseract image coordinates to coordinates used in the projection.
761767
int TextlineProjection::ImageXToProjectionX(int x) const {

0 commit comments

Comments
 (0)