phetsims/vector-addition

labels overlap for vector <-x,0>

Closed this issue · 9 comments

Test Device

  • MacBook Pro

Operating System

  • 10.15
  • 10.12.6

Browser

  • All latest

Problem Description
For phetsims/qa#445

The values will overlap with negative horizontal vectors.

Steps to Reproduce

  1. Check the Values box

  2. Click the angle vectors button.

Screen Shot 2019-10-31 at 11 49 48 AM

  1. Pick eather of these conponents.
    Screen Shot 2019-10-31 at 11 49 15 AM Screen Shot 2019-10-31 at 11 49 22 AM

  2. Make the horizontal vector negative.

Visuals
Kapture 2019-10-31 at 11 42 07

Troubleshooting Information Troubleshooting information: !!!!! DO NOT EDIT !!!!! Name: ‪Vector Addition: Equations‬ URL: https://phet-dev.colorado.edu/html/vector-addition-equations/1.0.0-rc.1/phet/vector-addition-equations_all_phet.html Version: 1.0.0-rc.1 2019-10-23 17:35:42 UTC Features missing: touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.2 Safari/605.1.15 Language: en-US Window: 1408x734 Pixel Ratio: 2/1 WebGL: WebGL 1.0 GLSL: WebGL GLSL ES 1.0 (1.20) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 15 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 16) Max viewport: 8192x8192 OES_texture_float: true Dependencies JSON: {}

Good find @megan-phet. I have reproduced in master and 1.0.0-rc.1. What we're seeing in the above screenshot is the vector label (|a⃗| = -15) and the label on it's x component vector (15.0). The y component label is hidden because its magnitude is 0.

Even if I fix the overlap issue, I'm not sure what advantage there is to labeling only one of the component vectors when one of them is zero. Examples of the 4 cases:

a⃗ = <10,0>
screenshot_1664

a⃗ = <-10,0>
screenshot_1665

a⃗ = <0,10>
screenshot_1667

a⃗ = <0,-10>
screenshot_1668

Proposal: When either x or y is zero, hide both component vector labels. Do this for the "triangle" and "parallelogram" component styles. The "projection" style would continue to show the non-zero component vector's label.

@arouinfar your thoughts?

Proposal: When either x or y is zero, hide both component vector labels. Do this for the "triangle" and "parallelogram" component styles. The "projection" style would continue to show the non-zero component vector's label.

Excellent suggestion, let's do it. In the triangle and parallelogram styles, the non-zero component of a 1D vector is redundant and I think hiding it would certainly look cleaner.

Thanks @arouinfar, I'll proceed.

Changed as proposed in master and 1.0. @arouinfar would you please verify in master?

Noting that it can occur in phetsims/qa#446 too

Looks good in master @pixelzoom

This fix has been implemented. Some overlap can still occur under similar circumstances with small slopes. If this is acceptable please close.
someoverlap

Thanks @KatieWoe. I'd say this overlap is akin to #267, so closing.