diff --git a/modules/juce_graphics/images/juce_ImageFileFormat.cpp b/modules/juce_graphics/images/juce_ImageFileFormat.cpp index 35158c9e51..81a2ddd1af 100644 --- a/modules/juce_graphics/images/juce_ImageFileFormat.cpp +++ b/modules/juce_graphics/images/juce_ImageFileFormat.cpp @@ -26,17 +26,17 @@ BEGIN_JUCE_NAMESPACE //============================================================================== -struct DefaultImageFormats -{ - PNGImageFormat png; - JPEGImageFormat jpg; - GIFImageFormat gif; -}; - -static DefaultImageFormats defaultImageFormats; - ImageFileFormat* ImageFileFormat::findImageFormatForStream (InputStream& input) { + struct DefaultImageFormats + { + PNGImageFormat png; + JPEGImageFormat jpg; + GIFImageFormat gif; + }; + + static DefaultImageFormats defaultImageFormats; + ImageFileFormat* formats[] = { &defaultImageFormats.png, &defaultImageFormats.jpg, &defaultImageFormats.gif }; @@ -68,11 +68,11 @@ Image ImageFileFormat::loadFrom (InputStream& input) Image ImageFileFormat::loadFrom (const File& file) { - InputStream* const in = file.createInputStream(); + FileInputStream stream (file); - if (in != nullptr) + if (stream.openedOk()) { - BufferedInputStream b (in, 8192, true); + BufferedInputStream b (stream, 8192); return loadFrom (b); } diff --git a/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp b/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp index bde6d9b61b..e68f224cad 100644 --- a/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp +++ b/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp @@ -201,17 +201,14 @@ void ComponentBoundsConstrainer::checkBounds (Rectangle& bounds, const bool isStretchingBottom, const bool isStretchingRight) { - // constrain the size if it's being stretched.. if (isStretchingLeft) bounds.setLeft (jlimit (old.getRight() - maxW, old.getRight() - minW, bounds.getX())); - - if (isStretchingRight) + else bounds.setWidth (jlimit (minW, maxW, bounds.getWidth())); if (isStretchingTop) bounds.setTop (jlimit (old.getBottom() - maxH, old.getBottom() - minH, bounds.getY())); - - if (isStretchingBottom) + else bounds.setHeight (jlimit (minH, maxH, bounds.getHeight())); if (bounds.isEmpty()) diff --git a/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.h b/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.h index c8da158b7f..1208697b0c 100644 --- a/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.h +++ b/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.h @@ -181,7 +181,7 @@ public: /** Called by setBoundsForComponent() to apply a new constrained size to a component. - By default this just calls setBounds(), but it virtual in case it's needed for + By default this just calls setBounds(), but is virtual in case it's needed for extremely cunning purposes. */ virtual void applyBoundsToComponent (Component* component, diff --git a/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm index 46512b893b..89125b40ac 100644 --- a/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm @@ -388,12 +388,15 @@ UIViewComponentPeer::UIViewComponentPeer (Component* const component, view = [[JuceUIView alloc] initWithOwner: this withFrame: r]; + view.multipleTouchEnabled = YES; + view.hidden = ! component->isVisible(); + view.opaque = component->isOpaque(); + view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent: 0]; + if (isSharedWindow) { window = [viewToAttachTo window]; [viewToAttachTo addSubview: view]; - - setVisible (component->isVisible()); } else { @@ -405,11 +408,8 @@ UIViewComponentPeer::UIViewComponentPeer (Component* const component, window = [[JuceUIWindow alloc] init]; window.frame = r; - window.opaque = component->isOpaque(); - view.opaque = component->isOpaque(); window.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent: 0]; - view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent: 0]; [((JuceUIWindow*) window) setOwner: this]; @@ -419,10 +419,7 @@ UIViewComponentPeer::UIViewComponentPeer (Component* const component, [window addSubview: view]; view.frame = CGRectMake (0, 0, r.size.width, r.size.height); - view.hidden = ! component->isVisible(); - window.hidden = ! component->isVisible(); - - view.multipleTouchEnabled = YES; + window.hidden = view.hidden; } setTitle (component->getName()); @@ -441,7 +438,7 @@ UIViewComponentPeer::~UIViewComponentPeer() if (! isSharedWindow) { - [((JuceUIWindow*) window) setOwner: 0]; + [((JuceUIWindow*) window) setOwner: nil]; [window release]; } } diff --git a/modules/juce_gui_basics/windows/juce_ResizableWindow.h b/modules/juce_gui_basics/windows/juce_ResizableWindow.h index 547be4861f..3b082d9d17 100644 --- a/modules/juce_gui_basics/windows/juce_ResizableWindow.h +++ b/modules/juce_gui_basics/windows/juce_ResizableWindow.h @@ -377,7 +377,7 @@ private: void initialise (bool addToDesktop); void updateLastPos(); - void setContent (Component* newComp, bool takeOwnership, bool resizeToFit); + void setContent (Component*, bool takeOwnership, bool resizeToFit); #if JUCE_CATCH_DEPRECATED_CODE_MISUSE // The parameters for these methods have changed - please update your code!