Giter VIP home page Giter VIP logo

swsnapshotstackview's People

Contributors

raztor0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swsnapshotstackview's Issues

Shadows render incorrectly on iOS <3.2

Testing on a device running iOS 3.1.3 I noticed shadows were not being rendered correctly.

It turns out Apple inverted the shadow offset (base translation) direction for the y-axis in iOS 3.2, hence the shadows are being drawn up instead of down on iOS version prior to 3.2.

Refer to:
https://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GraphicsDrawingOverview/GraphicsDrawingOverview.html

Paragraph:

Note: Prior to iOS 3.2, Core Graphics and UIKit shared the same convention for shadow direction: positive offset values make the shadow go down and to the right of an object.

Capture touch events and call specified action

I use Snapshot Stack View within my application as a thumbnail and entry point to the full-screen image browser, there I would like to capture touch events to trigger the view controller transition.

When userInteractionEnabled is YES, if registered, calls specified action on touch up similar to a UIButton.
Touches are obviously ignored if userInteractionEnabled is NO.

Please let me know if other users of this control require finer grain control over touches.

Provide configurable cropping options

Currently the view respects the specified images aspect ratio and scalings its rendering to maintain this aspect ratio within the current views frame.

Optionally users may wish to define a desired aspect ratio (via views frame) which should crop/scale the specified image to fit. For example users may wish to crop to a square aspect.

Better support for smaller view frames

Magnitude of rendered effects (matte frame and drop shadows) are currently static (optimised for medium to larger view frames on an iPhone) and independant of the views dimensions.

Effects should be scaled to reduce their effect on smaller frame sizes.

Relates to Issue #2

Randomise angles of rotation for snapshots in a stack

Optionally randomise angles of rotation (i.e. positions) of all snapshots below the top most snapshot.
Configurable via a property, OFF by default.

Randomisation should occur on change of image property and change of display mode via displayAsStack property.

Randomisation is restricted by:

  • Between a predefined Minimum & Maximum allowable angle of rotation
  • Consecutive snapshots should be seperated by a minimum angle to avoid equal angles of rotation overlapping snapshots.

Square images do not have correct frame when displayed not as stack

Square images have a frame top & bottom with the image going all the way to the sides on left and right.
Displayed as stack the problem is not there.

Just change code to this for it to work properly in SWSnapshotStackView.m

// SINGLE SNAPSHOT DISPLAY MODE

CGSize scaledImageSize;

// Calculate required scaling of image to fit within the views frame
// using the images aspect ratio to determine the largest dimension
// to drive scaling factor, leaving room for matte frame and shadow
if (m_imageAspect > 1.0 || m_imageAspect == 1.0 )
{

ie: add on || m_imageAspect == 1.0

Reducing matte frame width results in uneven rendering

Raised by Cho Seungbo on 9 January 2012 within Cocoa Controls comments:

When I set SWSnapshotStackViewMatteWidth = 3, the margin of left and top looks 3, but the margin of right and bottom is 2.

Suspect it's a rounding issue in frame calculations. As I round both the calculated matte frame and UIImage rectangle to make sure they are aligned appropriately for drawing to avoid unnecessary anti-aliasing (i.e. drawing between pixels, etc).
Lines are drawn on 0.5 point coordinates, UIImage drawn on integer coordinates.

Relates to known issue of using view with smaller frame sizes and scaling of effects to better suit.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.