Coder Social home page Coder Social logo

placement's Introduction

Hi there ๐Ÿ‘‹

placement's People

Contributors

sampettersson 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

Watchers

 avatar  avatar  avatar

placement's Issues

1.5.0 makes different layout behavior against 1.4.1

first of all, I appreciate your wondrous works.
I've made a small library that lays elements out in flow.

https://github.com/FluidGroup/swiftui-WrapLayout

Then I noticed the latest version 1.5.0 that runs something different against 1.4.1.
Actually, laying out does not work correctly.

For now, it's still just head up for you. I will investigate more about what's going on inside.

iOS 15.x

1.4.1
CleanShot 2023-06-12 at 14 18 30@2x

1.5.0 - all viewers are placed in same position.
CleanShot 2023-06-12 at 14 17 57@2x

makeCache is not called again when Layout should be invalidated from parameters.

Example:
Given we have a parameter columnCount that we pass into a PlacementLayout through init(columnCount: Int), I would expect the layout to invalidate and call makeCache(subviews:) so that a cache can be made taking new parameters into consideration. Layout has this behavior but PlacementLayout does not.

Sample:

AutoflowDenseGridPlacementLayout(columnCount: columnCount) {
    ForEach(Array(items.enumerated()), id: \.element) { index, item in
        ZStack {
            Color.red
            Text("\(index)")
                .foregroundColor(.white)
        }
        .placementLayoutValue(key: PAutoflowGridItemSizeValueKey.self, value: item.size)
    }
  }
  .padding(16)

Incorrect (PlacementLayout)

PlacementLayout_Incorrect.mp4

Correct (Layout):

Layout_Correct.mp4

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.