- Position adjustment patterns, if need be
768250
static void embedBasicPatterns(Version version, ByteMatrix matrix) throws WriterException {
    // Let's get started with embedding big squares at corners.
    embedPositionDetectionPatternsAndSeparators(matrix);
    // Then, embed the dark dot at the left bottom corner.
    embedDarkDotAtLeftBottomCorner(matrix);

    // Position adjustment patterns appear if version >= 2.
    maybeEmbedPositionAdjustmentPatterns(version, matrix);
    // Timing patterns should be embedded after position adj. patterns.
    embedTimingPatterns(matrix);
  }
352750
def _adjust_anchors(anchor_data, ufo, component):
    """"""

    glyph = ufo[component.baseGlyph]
    t = Transform(*component.transformation)
    for anchor in glyph.anchors:
        # only adjust if this anchor has data and the component also contains
        # the associated mark anchor (e.g. "_top" for "top")
        if anchor.name in anchor_data and any(
            a.name == "_" + anchor.name for a in glyph.anchors
        ):
            anchor_data[anchor.name] = t.transformPoint((anchor.x, anchor.y))
459505
def x(self, position=None):
        """"""
        p = self.GetPosition()
        if position is None:
            return p[0]
        self.SetPosition(position, p[1], p[2])
        if self.trail:
            self.updateTrail()
        return self
1122084
def adjust_size_to(size, adjust=" ", orientation=:left)
			if self.size > size
				truncate(size, omission: '')
			elsif orientation == :left
				ljust(size, adjust)
			else
				rjust(size, adjust)				
			end
		end
1213385
private void  fillWithPattern(SvgElement obj, Path path, Pattern pattern)
   {
      boolean      patternUnitsAreUser = (pattern.patternUnitsAreUser != null && pattern.patternUnitsAreUser);
      float        x, y, w, h;
      float        originX, originY;

      if (pattern.href != null)
         fillInChainedPatternFields(pattern, pattern.href);

      if (patternUnitsAreUser)
      {
         x = (pattern.x != null) ? pattern.x.floatValueX(this): 0f;
         y = (pattern.y != null) ? pattern.y.floatValueY(this): 0f;
         w = (pattern.width != null) ? pattern.width.floatValueX(this): 0f;
         h = (pattern.height != null) ? pattern.height.floatValueY(this): 0f;
      }
      else
      {
         // Convert objectBoundingBox space to user space
         x = (pattern.x != null) ? pattern.x.floatValue(this, 1f): 0f;
         y = (pattern.y != null) ? pattern.y.floatValue(this, 1f): 0f;
         w = (pattern.width != null) ? pattern.width.floatValue(this, 1f): 0f;
         h = (pattern.height != null) ? pattern.height.floatValue(this, 1f): 0f;
         x = obj.boundingBox.minX + x * obj.boundingBox.width;
         y = obj.boundingBox.minY + y * obj.boundingBox.height;
         w *= obj.boundingBox.width;
         h *= obj.boundingBox.height;
      }
      if (w == 0 || h == 0)
         return;

      // "If attribute 'preserveAspectRatio' is not specified, then the effect is as if a value of xMidYMid meet were specified."
      PreserveAspectRatio  positioning = (pattern.preserveAspectRatio != null) ? pattern.preserveAspectRatio : PreserveAspectRatio.LETTERBOX;

      // Push the state
      statePush();
      // Set path as the clip region
      canvas.clipPath(path);

      // Set the style for the pattern (inherits from its own ancestors, not from callee's state)
      RendererState  baseState = new RendererState();
      updateStyle(baseState, Style.getDefaultStyle());
      baseState.style.overflow = false;    // By default patterns do not overflow

      // SVG2 TODO: Patterns now inherit from the element referencing the pattern
      state = findInheritFromAncestorState(pattern, baseState);

      // The bounds of the area we need to cover with pattern to ensure that our shape is filled
      Box  patternArea = obj.boundingBox;
      // Apply the patternTransform
      if (pattern.patternTransform != null)
      {
         canvas.concat(pattern.patternTransform);
         
         // A pattern transform will affect the area we need to cover with the pattern.
         // So we need to alter the area bounding rectangle.
         Matrix inverse = new Matrix();
         if (pattern.patternTransform.invert(inverse)) {
            float[] pts = {obj.boundingBox.minX, obj.boundingBox.minY,
                           obj.boundingBox.maxX(), obj.boundingBox.minY,
                           obj.boundingBox.maxX(), obj.boundingBox.maxY(),
                           obj.boundingBox.minX, obj.boundingBox.maxY()};
            inverse.mapPoints(pts);
            // Find the bounding box of the shape created by the inverse transform 
            RectF  rect = new RectF(pts[0], pts[1], pts[0], pts[1]);
            for (int i=2; i<=6; i+=2) {
               if (pts[i] < rect.left) rect.left = pts[i]; 
               if (pts[i] > rect.right) rect.right = pts[i]; 
               if (pts[i+1] < rect.top) rect.top = pts[i+1]; 
               if (pts[i+1] > rect.bottom) rect.bottom = pts[i+1]; 
            }
            patternArea = new Box(rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top);
         }
      }

      // Calculate the pattern origin
      originX = x + (float) Math.floor((patternArea.minX - x) / w) * w;
      originY = y + (float) Math.floor((patternArea.minY - y) / h) * h;

      // For each Y step, then each X step
      float  right = patternArea.maxX();
      float  bottom = patternArea.maxY();
      Box    stepViewBox = new Box(0,0,w,h);

      boolean  compositing = pushLayer();

      for (float stepY = originY; stepY < bottom; stepY += h)
      {
         for (float stepX = originX; stepX < right; stepX += w)
         {
            stepViewBox.minX = stepX;
            stepViewBox.minY = stepY;

            // Push the state
            statePush();

            // Set pattern clip rectangle if appropriate
            if (!state.style.overflow) {
               setClipRect(stepViewBox.minX, stepViewBox.minY, stepViewBox.width, stepViewBox.height);
            }
            // Calculate and set the viewport for each instance of the pattern
            if (pattern.viewBox != null)
            {
               canvas.concat(calculateViewBoxTransform(stepViewBox, pattern.viewBox, positioning));
            }
            else
            {
               boolean  patternContentUnitsAreUser = (pattern.patternContentUnitsAreUser == null || pattern.patternContentUnitsAreUser);
               // Simple translate of pattern to step position
               canvas.translate(stepX, stepY);
               if (!patternContentUnitsAreUser) {
                  canvas.scale(obj.boundingBox.width, obj.boundingBox.height);
               }
            }


            // Render the pattern
            for (SVG.SvgObject child: pattern.children) {
               render(child);
            }

            // Pop the state
            statePop();
         }
      }

      if (compositing)
         popLayer(pattern);

      // Pop the state
      statePop();
   }
1312086
def positions(self):
        
        for y in range(self.height):
            for x in range(self.length):
                yield x, y
1251171
def set_position(self, pos, which='both'):
        """"""
        self._polar.set_position(pos, which)
        if self._overlay_axes is not None:
            self._overlay_axes.set_position(pos, which)
        LambertAxes.set_position(self, pos, which)
1295124
def adjustWPPointer(self):
        ''''''
        self.headingWPText.set_size(self.fontSize) 
        headingRotate = mpl.transforms.Affine2D().rotate_deg_around(0.0,0.0,-self.wpBearing+self.heading)+self.axes.transData
        self.headingWPText.set_transform(headingRotate)
        angle = self.wpBearing - self.heading
        if angle < 0:
            angle += 360
        if (angle > 90) and (angle < 270):
            headRot = angle-180
        else:
            headRot = angle
        self.headingWPText.set_rotation(-headRot)
        self.headingWPTri.set_transform(headingRotate)
        self.headingWPText.set_text('%.f' % (angle))
3051
protected void adjustHomographSign( AssociatedPair p , DMatrixRMaj H ) {
		double val = GeometryMath_F64.innerProd(p.p2, H, p.p1);

		if( val < 0 )
			CommonOps_DDRM.scale(-1, H);
	}
1234573
private void maybeUpdateScrollbarPositions() {

        if (!isAttached()) {
            return;
        }

        if (m_scrollbar != null) {
            int vPos = getVerticalScrollPosition();
            if (m_scrollbar.getVerticalScrollPosition() != vPos) {
                m_scrollbar.setVerticalScrollPosition(vPos);
            }
        }
    }
877462
void adjustScroll() {

        if (iRowHeight == 0) {
            return;
        }

        int w = 0;

        for (int i = 0; i < iColCount; i++) {
            w += iColWidth[i];
        }

        iGridWidth  = w;
        iGridHeight = iRowHeight * (iRowCount + 1);

        sbHoriz.setValues(iX, iWidth, 0, iGridWidth);

        int v = iY / iRowHeight,
            h = iHeight / iRowHeight;

        sbVert.setValues(v, h, 0, iRowCount + 1);

        iX = sbHoriz.getValue();
        iY = iRowHeight * sbVert.getValue();
    }
766954
private void applyPosition() {
		background.setBounds(new Bbox(getHorizontalMargin(), getVerticalMargin(), getWidth(), getHeight()));

		north.setHorizontalMargin(getHorizontalMargin() + 16);
		north.setVerticalMargin(getVerticalMargin());

		east.setHorizontalMargin(getHorizontalMargin() + 32);
		east.setVerticalMargin(getVerticalMargin() + 16);

		south.setHorizontalMargin(getHorizontalMargin() + 16);
		south.setVerticalMargin(getVerticalMargin() + 32);

		west.setHorizontalMargin(getHorizontalMargin());
		west.setVerticalMargin(getVerticalMargin() + 16);
	}
554910
function findExistingAdjustment(next) {
      // prepare criteria by _id or fields
      let criteria = _.merge({}, _adjustment);
      criteria = (
        criteria._id ?
        _.pick(criteria, '_id') :
        _.pick(criteria, 'type', 'reason', 'item', 'stock', 'store')
      );
      Adjustment.findOne(criteria, next);
    }
569654
def adjust_to_360(val, key):
    
    CheckDec = ['_dec', '_lon', '_azimuth', 'dip_direction']
    adjust = False
    for dec_key in CheckDec:
        if dec_key in key:
            if key.endswith(dec_key) or key.endswith('_'):
                adjust = True
    if not val:
        return ''
    elif not adjust:
        return val
    elif adjust:
        new_val = float(val) % 360
        if new_val != float(val):
            print('-I- adjusted {} {} to 0=>360.: {}'.format(key, val, new_val))
        return new_val
770438
def __set_position(self):
        

        rectangle = hasattr(self.parent(), "viewport") and self.parent().viewport().rect() or self.parent().rect()
        if not rectangle:
            return

        self.adjustSize()

        if self.__anchor == 0:
            point_x = rectangle.width() / 2 - self.width() / 2
            point_y = self.__vertical_padding
        elif self.__anchor == 1:
            point_x = rectangle.width() - self.width() - self.__horizontal_padding
            point_y = self.__vertical_padding
        elif self.__anchor == 2:
            point_x = rectangle.width() - self.width() - self.__horizontal_padding
            point_y = rectangle.height() / 2 - self.height() / 2
        elif self.__anchor == 3:
            point_x = rectangle.width() - self.width() - self.__horizontal_padding
            point_y = rectangle.height() - self.height() - self.__vertical_padding
        elif self.__anchor == 4:
            point_x = rectangle.width() / 2 - self.width() / 2
            point_y = rectangle.height() - self.height() - self.__vertical_padding
        elif self.__anchor == 5:
            point_x = self.__horizontal_padding
            point_y = rectangle.height() - self.height() - self.__vertical_padding
        elif self.__anchor == 6:
            point_x = self.__horizontal_padding
            point_y = rectangle.height() / 2 - self.height() / 2
        elif self.__anchor == 7:
            point_x = self.__horizontal_padding
            point_y = self.__vertical_padding
        elif self.__anchor == 8:
            point_x = rectangle.width() / 2 - self.width() / 2
            point_y = rectangle.height() / 2 - self.height() / 2

        self.setGeometry(point_x + self.__horizontal_offset, point_y +
                                                             self.__vertical_offset, self.width(), self.height())
1310834
private void adjustOriginalPositionIndicator(
        CmsSitemapTreeItem draggable,
        I_CmsDropTarget target,
        CmsDNDHandler handler) {

        if (!isChangedPosition(draggable, target, true)) {
            draggable.getElement().addClassName(I_CmsSitemapLayoutBundle.INSTANCE.sitemapItemCss().markUnchanged());
            List<Element> itemWidget = CmsDomUtil.getElementsByClass(
                org.opencms.gwt.client.ui.css.I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().itemContainer(),
                handler.getPlaceholder());
            if ((itemWidget != null) && (itemWidget.size() > 0)) {
                CmsDomUtil.addDisablingOverlay(itemWidget.get(0));
            }
        } else {
            draggable.getElement().removeClassName(I_CmsSitemapLayoutBundle.INSTANCE.sitemapItemCss().markUnchanged());
            CmsDomUtil.removeDisablingOverlay(handler.getPlaceholder());
        }
    }
321926
function reorderFinderPatterns(pattern1, pattern2, pattern3) {
        // Find distances between pattern centers
        const oneTwoDistance = distance(pattern1, pattern2);
        const twoThreeDistance = distance(pattern2, pattern3);
        const oneThreeDistance = distance(pattern1, pattern3);
        let bottomLeft;
        let topLeft;
        let topRight;
        // Assume one closest to other two is B; A and C will just be guesses at first
        if (twoThreeDistance >= oneTwoDistance && twoThreeDistance >= oneThreeDistance) {
            [bottomLeft, topLeft, topRight] = [pattern2, pattern1, pattern3];
        }
        else if (oneThreeDistance >= twoThreeDistance && oneThreeDistance >= oneTwoDistance) {
            [bottomLeft, topLeft, topRight] = [pattern1, pattern2, pattern3];
        }
        else {
            [bottomLeft, topLeft, topRight] = [pattern1, pattern3, pattern2];
        }
        // Use cross product to figure out whether bottomLeft (A) and topRight (C) are correct or flipped in relation to topLeft (B)
        // This asks whether BC x BA has a positive z component, which is the arrangement we want. If it's negative, then
        // we've got it flipped around and should swap topRight and bottomLeft.
        if (((topRight.x - topLeft.x) * (bottomLeft.y - topLeft.y)) - ((topRight.y - topLeft.y) * (bottomLeft.x - topLeft.x)) < 0) {
            [bottomLeft, topRight] = [topRight, bottomLeft];
        }
        return { bottomLeft, topLeft, topRight };
    }