<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSImage/matchesOnlyOnBestFittingAxis",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSImage(py)matchesOnlyOnBestFittingAxis"
  },
  "title" : "matchesOnlyOnBestFittingAxis"
}
-->

# matchesOnlyOnBestFittingAxis

A Boolean value that indicates whether the image matches only on the best fitting axis.

```
var matchesOnlyOnBestFittingAxis: Bool { get set }
```

## Discussion

<doc://com.apple.documentation/documentation/Swift/true> if the image is drawn only on the best fitting axis; otherwise, <doc://com.apple.documentation/documentation/Swift/false>. This property defaults to <doc://com.apple.documentation/documentation/Swift/false>.

NSImage has always tried to use a representation with at least as many pixels as the destination rectangle. Many apps try to implement banners and 3 part / 9 part images by stretching an NSImage over a much larger area (usually only on a single axis).

With the addition of 2x assets these apps are finding this policy displays the 2x image rep when they would prefer the 1x rep. This behavior can be changed by using this method.

> Note:
> It is still preferable to use the ``doc://com.apple.appkit/documentation/AppKit/NSDrawThreePartImage(_:_:_:_:_:_:_:_:)`` and ``doc://com.apple.appkit/documentation/AppKit/NSDrawNinePartImage(_:_:_:_:_:_:_:_:_:_:_:_:_:)``, functions when possible.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)