Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add support to proportionally scale to fit to CPImageView #1500

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

BlairDuncan commented Apr 11, 2012

Although not in cocoa, in cappuccino it is required to display an image larger than its original size.

@aparajita aparajita commented on the diff Apr 11, 2012

AppKit/CPImageView.j
@@ -27,9 +27,10 @@
@import "CPShadowView.j"
-CPScaleProportionally = 0;
-CPScaleToFit = 1;
-CPScaleNone = 2;
+CPScaleProportionally = 0;
+CPScaleToFit = 1;
+CPScaleNone = 2;
+CPScaleToFitProportionally = 4;
@aparajita

aparajita Apr 11, 2012

Contributor

This isn't a bit flag, that should be 3, not 4.

@aparajita aparajita commented on the diff Apr 11, 2012

AppKit/CPImageView.j
@@ -310,11 +311,11 @@ var CPImageViewEmptyPlaceholderImage = nil;
if (size.width == -1 && size.height == -1)
return;
- if (imageScaling === CPScaleProportionally)
+ if (imageScaling === CPScaleProportionally || imageScaling === CPScaleToFitProportionally)
@aparajita

aparajita Apr 11, 2012

Contributor

Hmmm...looking at this whole chunk of code, including the if (imageScaling === CPScaleNone), it's pretty messy. And I can't even see where CPScaleToFit is handled. I think the whole section needs cleaning up.

Contributor

aparajita commented Apr 12, 2012

Turns out in Cocoa the current scaling constant names have been deprecated, and a new one, NSImageScaleProportionallyUpOrDown, has been added. I will merge your changes with some other fixes.

Contributor

aparajita commented Apr 12, 2012

Implemented in aeb2671, thanks for the inspiration.

@aparajita aparajita closed this Apr 12, 2012

@cappbot cappbot added this to the Someday milestone Sep 29, 2015

@cappbot cappbot added the #new label Sep 29, 2015

cappbot commented Sep 29, 2015

Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment