Exemple #1
0
 public PointF getElementCoordinates(
     float height, float width, RectF viewRect, PositionMetrics metrics) {
   float x = metrics.getXPositionMetric().getPixelValue(viewRect.width()) + viewRect.left;
   float y = metrics.getYPositionMetric().getPixelValue(viewRect.height()) + viewRect.top;
   PointF point = new PointF(x, y);
   return PixelUtils.sub(point, getAnchorOffset(width, height, metrics.getAnchor()));
 }
Exemple #2
0
 public static PointF getAnchorCoordinates(RectF widgetRect, Anchor anchor) {
   return PixelUtils.add(
       new PointF(widgetRect.left, widgetRect.top),
       getAnchorOffset(widgetRect.width(), widgetRect.height(), anchor));
 }