Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add CPScaleToFitProportionally to CPImageView

  • Loading branch information...
commit d725df2942943c300eef1654ae4684d3ed382eea 1 parent 7c6ad02
@BlairDuncan authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 AppKit/CPImageView.j
View
14 AppKit/CPImageView.j
@@ -27,9 +27,10 @@
@import "CPShadowView.j"
-CPScaleProportionally = 0;
-CPScaleToFit = 1;
-CPScaleNone = 2;
+CPScaleProportionally = 0;
+CPScaleToFit = 1;
+CPScaleNone = 2;
+CPScaleToFitProportionally = 4;
CPImageAlignCenter = 0;
CPImageAlignTop = 1;
@@ -318,11 +319,10 @@ var LEFT_SHADOW_INSET = 3.0,
if (size.width == -1 && size.height == -1)
return;
- if (imageScaling === CPScaleProportionally)
+ if (imageScaling === CPScaleProportionally || imageScaling === CPScaleToFitProportionally)
{
- // The max size it can be is size.width x size.height, so only
- // only proportion otherwise.
- if (width >= size.width && height >= size.height)
+ // The max size it can be is size.width x size.height, so only proportion otherwise.
+ if (width >= size.width && height >= size.height && imageScaling === CPScaleProportionally)
{
width = size.width;
height = size.height;
Please sign in to comment.
Something went wrong with that request. Please try again.