Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Issue 877243005: Add designer-selection element (Closed)

Created:
5 years, 10 months ago by justinfagnani
Modified:
5 years, 10 months ago
Reviewers:
imac
Base URL:
https://github.com/PolymerLabs/designer2.git@master
Visibility:
Public.

Description

Add designer-selection element BUG=

Patch Set 1 #

Patch Set 2 : Move style outside template #

Total comments: 28

Patch Set 3 : Review comments #

Patch Set 4 : Address more review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+330 lines, -0 lines) Patch
A .gitignore View 1 1 chunk +2 lines, -0 lines 0 comments Download
A bower.json View 1 2 3 1 chunk +12 lines, -0 lines 0 comments Download
A codereview.settings View 1 chunk +4 lines, -0 lines 0 comments Download
A elements/designer-selection/README.md View 1 chunk +11 lines, -0 lines 0 comments Download
A elements/designer-selection/ResizeDirection.js View 1 2 3 1 chunk +57 lines, -0 lines 0 comments Download
A elements/designer-selection/demo.html View 1 chunk +28 lines, -0 lines 0 comments Download
A elements/designer-selection/designer-selection.html View 1 2 3 1 chunk +216 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (5 generated)
justinfagnani
5 years, 10 months ago (2015-02-05 00:17:02 UTC) #2
justinfagnani
5 years, 10 months ago (2015-02-05 00:17:55 UTC) #4
imac
https://codereview.chromium.org/877243005/diff/20001/bower.json File bower.json (right): https://codereview.chromium.org/877243005/diff/20001/bower.json#newcode7 bower.json:7: "neoprene": "https://github.com/PolymerLabs/neoprene.git", PolymerLabs/neoprene is shorthand for this; consistency! https://codereview.chromium.org/877243005/diff/20001/elements/designer-selection/designer-selection.html ...
5 years, 10 months ago (2015-02-05 03:18:33 UTC) #5
powei
Sorry for the drive-by noise, but this review is being posted on to the public-facing ...
5 years, 10 months ago (2015-02-05 03:29:37 UTC) #7
justinfagnani
On 2015/02/05 03:29:37, powei wrote: > Sorry for the drive-by noise, but this review is ...
5 years, 10 months ago (2015-02-05 19:35:18 UTC) #8
justinfagnani
https://codereview.chromium.org/877243005/diff/20001/bower.json File bower.json (right): https://codereview.chromium.org/877243005/diff/20001/bower.json#newcode7 bower.json:7: "neoprene": "https://github.com/PolymerLabs/neoprene.git", On 2015/02/05 03:18:33, imac wrote: > PolymerLabs/neoprene ...
5 years, 10 months ago (2015-02-05 20:15:55 UTC) #9
imac
lgtm https://codereview.chromium.org/877243005/diff/20001/bower.json File bower.json (right): https://codereview.chromium.org/877243005/diff/20001/bower.json#newcode7 bower.json:7: "neoprene": "https://github.com/PolymerLabs/neoprene.git", On 2015/02/05 20:15:54, justinfagnani wrote: > ...
5 years, 10 months ago (2015-02-06 20:26:31 UTC) #11
justinfagnani
5 years, 10 months ago (2015-02-06 23:46:39 UTC) #13
Thanks!

https://codereview.chromium.org/877243005/diff/20001/bower.json
File bower.json (right):

https://codereview.chromium.org/877243005/diff/20001/bower.json#newcode7
bower.json:7: "neoprene": "https://github.com/PolymerLabs/neoprene.git",
On 2015/02/06 20:26:31, imac wrote:
> On 2015/02/05 20:15:54, justinfagnani wrote:
> > On 2015/02/05 03:18:33, imac wrote:
> > > PolymerLabs/neoprene is shorthand for this; consistency!
> > 
> > Done.
> 
> polymer & webcomponentsjs too

Done.

https://codereview.chromium.org/877243005/diff/20001/elements/designer-select...
File elements/designer-selection/designer-selection.html (right):

https://codereview.chromium.org/877243005/diff/20001/elements/designer-select...
elements/designer-selection/designer-selection.html:192: _handleDown:
function(e) {
On 2015/02/06 20:26:31, imac wrote:
> On 2015/02/05 20:15:54, justinfagnani wrote:
> > On 2015/02/05 03:18:33, imac wrote:
> > > _resizeDown/_resizeMove would be clearer, I think
> > 
> > _resizeHandleDown is the most clear!
> 
> Most clearerer!

Acknowledged.

https://codereview.chromium.org/877243005/diff/20001/elements/designer-select...
elements/designer-selection/designer-selection.html:214: direction.resizesLeft()
? this.offsetWidth + this.offsetLeft - x :
On 2015/02/06 20:26:31, imac wrote:
> On 2015/02/05 20:15:54, justinfagnani wrote:
> > On 2015/02/05 03:18:33, imac wrote:
> > > Rather than having to calculate offsetLeft/Top each frame, you might want
to
> > > just hold onto it when the move starts, and then just move relative to the
> > mouse
> > > position on mousedown. (also accumulation errors)
> > 
> > Yeah, this.offsetWidth + this.offsetLeft is what I need because offsetRight
> > doesn't exist. Right now anything I need to remember between callbacks has
to
> be
> > an instance member. I'd like to fix that so I can use scopes instead, so let
> me
> > defer this for now.
> 
> Hmm, I mean that you shouldn't need to refer to this.offset* _at all_ from
> within the move function. The thought is:
> 
> * in _resizeHandleDown, you store e.clientX/Y
> * in _resizeHandleMove, you just emit the delta between the current
e.clientX/Y
> and the value stored.
>   * or keep emitting the calculated size as you are, but you can calculate it
> from the original position, not the iterative one
> 
> This saves you from a few potential sources of error:
> 
> * If someone upstream does something whacky (resizing the element while
> resizing, bad math, whatever), the resizer isn't going to flip its shit
> * You don't have to worry about accumulation errors (constantly adding
offsets;
> though integers, so maybe not a concern).
> * What happens when an element resizes down to 0 width or height?
> * If you just pass the deltas up, the code managing the resize can do whatever
> it wants. And because it's the delta from the original position, you're not
> dependent on the state from the previous move events

Yes, but I want to restructure this so I don't have to keep adding instance
members to remember values between event callbacks. I'll revisit very soon.

Powered by Google App Engine
This is Rietveld 408576698