Skip to content

Commit

Permalink
a fix for #78
Browse files Browse the repository at this point in the history
  • Loading branch information
stolstov committed Feb 20, 2015
1 parent e59f9b1 commit 0570d12
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ void strokeDrawPolyPath(SimpleRasterizer rasterizer,
}

int worldToPixX(double x) {
return (int) Math.round(x * m_dx + m_x0);
return (int) (x * m_dx + m_x0);
}

int worldToPixY(double y) {
return (int) Math.round(y * m_dy + m_y0);
return (int) (y * m_dy + m_y0);
}

RasterizedGeometry2DImpl(Geometry geom, double toleranceXY,
Expand Down Expand Up @@ -405,6 +405,9 @@ void buildLevels() {

@Override
public HitType queryPointInGeometry(double x, double y) {
if (!m_geomEnv.contains(x, y))
return HitType.Outside;

int ix = worldToPixX(x);
int iy = worldToPixY(y);
if (ix < 0 || ix >= m_width || iy < 0 || iy >= m_width)
Expand All @@ -423,7 +426,8 @@ else if (res == 1)
@Override
public HitType queryEnvelopeInGeometry(Envelope2D env) {
if (!env.intersect(m_geomEnv))
return com.esri.core.geometry.RasterizedGeometry2D.HitType.Outside;
return HitType.Outside;

int ixmin = worldToPixX(env.xmin);
int ixmax = worldToPixX(env.xmax);
int iymin = worldToPixY(env.ymin);
Expand Down

0 comments on commit 0570d12

Please sign in to comment.