4 ms·
I would like to suggest this minor change: create table layers (id text, parent_id text, sequence integer, uti text, name text, data blob); become (Vec2 use
by angersock 14y ago
I would like to suggest this minor change:
create table layers (id text, parent_id text, sequence integer, uti text, name text, data blob);
become (Vec2 used for notation's sake to make the declaration simpler--just two reals):
create table layers (id text, parent_id text, sequence integer, uti text, name text, data blob, offset Vec2, bounds Vec2, rotation real);
This would make it really easy to ignore layers which have no component in the view space, or to compactly represent raster subimages.
"bounds" is the size of the axis-aligned bounding-box of the image. "offset" i a translation from the center of the axis-aligned bounding-box of the layer image data to the origin, and "rotation" is the rotation (in radians, CCW) of the layer. Order of application is rotation, then translation.
EDIT: Fixed missing def for "bounds".
- eridius 14y agoI think you're missing something in your comment. There's no change between the two lines, and no reference to offset or rotation.
- aeontech 14y agomouse over the declaration line and scroll left.
- eridius 14y agoOh, wow. HN really truncates that early. Those code blocks were narrower than the surrounding text, with no indication whatsoever that they were independently scrolling divs. I get that HN is awfully bare-bones in its appearance, but this I think is a bit too far.
- chc 14y agoThat is a problem with your browser not clearly indicating scrollable areas. Hacker News doesn't do anything special to prevent browsers from showing scrollbars.
- eridius 14y agoBut it doesn't do anything to force the scrollbars either, or to provide a visual treatment that indicates that this is an independent scrollable area. We've had iOS around for 6 years now, with its hidden-scrollbars approach, and OS X has followed the hidden-scrollbars approach for some time now as well. It is no longer acceptable to assume that scrollbars are necessarily going to be visible.
- prodigal_erik 14y agoHN's semantic markup isn't always great, but in this case it simply uses <pre> styled with overflow: auto. > The behavior of the 'auto' value is user agent-dependent, but should cause a scrolling mechanism to be provided for overflowing boxes. — http://www.w3.org/TR/CSS2/visufx.html#overflow http://www.w3.org/TR/CSS2/visufx.html#overflow Apple's rendering is overly pretty to the point of being useless. They dropped support for a perfectly reasonable semantic requirement (make all the content available) which was in the spec literally before their browser existed.
- chc 14y agoHacker News does everything it is supposed to according to the CSS standard to indicate to your browser that the area is scrollable. In fact, it is obvious that the site is doing enough because the browser does in fact render the area as scrollable. The fact that your browser doesn't do anything to visually indicate when a region is an independent scrollable area is entirely Apple's fault. You can argue that websites should be written to conform to the standards-violating behavior in Apple's browser rather than actual Web standards, but we already went through that with Microsoft in the '90s and early 2000s, and I don't think you'll find a lot of people who are eager to return to those days. Browser-makers are expected to conform to the standard, not vice-versa. I am sympathetic to the fact that this is inconvenient, because I use Apple's software too. But it's Apple that's responsible for the inconvenience, not all the web designers who are correctly following the standard.
- crgt 14y agoHuh. So do we build sites for users or to satisfy specs?
- seanalltogether 14y agoI would argue you're not gaining much by complicating that specific table structure, since that information is going to be stored in the layer_attributes table where it naturally belongs. There may be several other attributes that can affect whether or not to load the resulting binary blob into memory.