Web Platform Team Blog

Adobe

decor

Making the web awesome

First Fit Layout Location for Rounded Rectangles

In the past, Hans has explained the first-fit layout algorithm for polygonal shaped exclusions. This algorithm is used to find the topmost location that a content box can fit into. Now he has written up a post on using the first-fit algorithm on rounded rectangle shapes. Interestingly enough, rounded rectangles do not only include rectangles with rounded corners; standard rectangles, ellipses, and even circles can all be specified as rounded rectangles. Thus, this algorithm can be used to fit content inside of all of these shapes. Even if you’re not interested in all of the implementation details, Hans’s post includes an interactive demonstration of the algorithm that is worth checking out.

Read more at Hans Muller’s blog.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>