adobe-photoshop / spaces-design

Adobe Photoshop Design Space
http://adobe-photoshop.github.io/
Other
848 stars 81 forks source link

Error creating mask on group where first child layer is a shape #3753

Closed chadrolfs closed 8 years ago

chadrolfs commented 8 years ago

new doc, drag out a couple shapes, group them (cmd+g), hit M

Action tools.changeVectorMaskMode failed: TypeError: Cannot read property 'top' of null

chadrolfs commented 8 years ago

Related to #3267

mask-errongroup

chadrolfs commented 8 years ago

screen shot 2016-02-24 at 2 25 43 pm

baaygun commented 8 years ago

@pineapplespatula I've started work on this in barkin/3753 where I fix this issue (with a simple bounds check). But there is a much bigger underlying issue (#3754).

Also, even with my fix, because applyEllipse itself switches tools to superselect, we never redraw our policy borders, so clicks will not go correctly.

I tried making sense of the mask code but I'm not familiar with it. You may know the reason why or figure out how we can fix this without adding yet another check to resetBorderPoliciesThrottled call conditions.

Passing it to you, @pineapplespatula.

pineapplespatula commented 8 years ago

3754 is the same issue, there isn't a valid bounds on the group upon creation. I tested out your branch but i'm still seeing the same problem there.

there is already a check for this.flux.store("tool").on("change", _borderPolicyChangeHandler); so i'm not sure why the vector mask state changing doesn't cause the change since

are we not emiting a tool store event on the tool change?

back to @volfied

baaygun commented 8 years ago

Please check out commit https://github.com/adobe-photoshop/spaces-design/commit/c8b2f31c778e2afb33e52d6cad8902f6330504de and try reproducing both bugs.

baaygun commented 8 years ago

@chadrolfs please test this with the newly merged PR #3760