Fork me on GitHub

Is there a reason rotate is private in membrane.ui? Is it just because it's not implemented yet on the backends?


Same issue with not being sure if negative origins work. There’s also a weird issue that if you rotate a box, it’s bounding box will warp. If you don’t keep track of the original bounding box, then rotating an object 45 degrees 8 times can cause the bounding box to grow large even though it should just return the object to it’s original orientation.


Oh that makes sense


Membrane’s ui model is based on boxes (bounds and origin). One of the things that seems obvious in retrospect is that it would be better to base a model on 2D geometry.


I think it’s neat that just by using regular clojure, it would be possible to build a better model that supports the current one without breaking anything


One of the unfortunate parts of membrane is that it has a pretty huge surface area. Many of the pieces that compose membrane could be their own library. The consequence of all UIs being more or less built on top of GTK, UIKit, Swing, JavaFx, HTML is that it's really hard to find simple functional libraries that solve just one part of the problem.


by "base a model on 2D geometry" do you mean that all the ui objects would have something like x/y/h/w instead of bounds/origin?


I haven't thought through all of the implications, but at the bottom, it would look a lot like just a math geometry library. Points, Paths, polygons, circles, etc. Width and height would be implemented, but you would also have access to bounding shape (rather than just bounding box), intersection, convexity, and a whole suite of geometric functions


Just like clojure.core provides a huge standard library that works with a bunch of abstract data types, you would have a model that provides a huge standard library that works with 2d geometries


Gotcha. Have you used / / Quil ? They seem to have a similar approach but are much less (or not at all) platform agnostic


I've seen those libraries, but haven't used them except for a small amount of Quil.


I think something like thi-ng/geom looks the most promising


The way I think about it is that making a better UI model is an improvement, but not a game changer. Currently, my next goals are: • improve state management compatibility with data models like datascript, crux, datomic, etc. • write an Graphical UI editor that let's you build real UI components (not just prototypes) a la Would love to hear what you think.


Cool, I'll watch it over the weekend!


I would definitely recommend all of the Bret Victor talks: (see demos section).


Yeah I've used all those graphics libraries to varying degrees. Mainly I just want an abstraction layer to switch backends easily. It takes too much to draw a thing that's just a few lines and circles on one platform then switch to a hugely different one, even though conceptually the visualizations are identical. I took a stab at a generic "data specification" for shapes/paints etc but wasn't really satisfied with it