MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / drawCircle

Method drawCircle

CodenameOne/src/com/codename1/maps/MapView.java:436–459  ·  view source on GitHub ↗
(Graphics g, Circle c)

Source from the content-addressed store, hash-verified

434 }
435
436 private void drawCircle(Graphics g, Circle c) {
437 if (!c.isVisible()) {
438 return;
439 }
440 Point center = engine.latLngToScreen(c.getCenter());
441 LatLng north = new LatLng(c.getCenter().getLatitude() + c.getRadiusMeters() / 111320.0,
442 c.getCenter().getLongitude());
443 Point np = engine.latLngToScreen(north);
444 int r = (int) Math.abs(center.getY() - np.getY());
445 if (r < 1) {
446 r = 1;
447 }
448 int fill = c.getFillColor();
449 int fa = (fill >>> 24) & 0xff;
450 g.setColor(fill & 0xffffff);
451 g.setAlpha(fa == 0 ? 255 : fa);
452 g.fillArc(center.getX() - r, center.getY() - r, r * 2, r * 2, 0, 360);
453 if (c.getStrokeWidth() > 0) {
454 g.setColor(c.getStrokeColor());
455 g.setAlpha(255);
456 g.drawArc(center.getX() - r, center.getY() - r, r * 2, r * 2, 0, 360);
457 }
458 g.setAlpha(255);
459 }
460
461 private void drawMarker(Graphics g, Marker m) {
462 if (!m.isVisible()) {

Callers 1

drawOverlaysMethod · 0.95

Calls 15

absMethod · 0.95
getYMethod · 0.95
getXMethod · 0.95
getRadiusMetersMethod · 0.80
isVisibleMethod · 0.65
latLngToScreenMethod · 0.65
getCenterMethod · 0.65
getLatitudeMethod · 0.65
getLongitudeMethod · 0.65
getFillColorMethod · 0.45
setColorMethod · 0.45
setAlphaMethod · 0.45

Tested by

no test coverage detected