Skip to content

Doesn’t Scale if elements are % (or vw/vh) #42

@Villmer

Description

@Villmer

Describe the bug
if docs are % (or vw/vh), the elements should scale when window resized.

To Reproduce
Steps to reproduce the behavior:
<!— 2 divs —>

// JS

var modxy1 = new JoyStick('xy1', {
    internalFillColor:'#db3236',
    internalStrokeColor:'#db3236',
    externalStrokeColor:'rgba(0,0,0,0)',
    //internalLineWidth:0,
    externalLineWidth:4,
}, function(stickData) {xy1_dir = stickData.cardinalDirection});
var modxy2 = new JoyStick('xy2', {
    internalFillColor:'#4885ed',
    internalStrokeColor:'#4885ed',
    externalStrokeColor:'rgba(0,0,0,0)',
    //internalLineWidth:0,
    externalLineWidth:4,
}, function(stickData) {xy2_dir = stickData.cardinalDirection});

Expected behavior
Should scale elements and re-center circle
Screenshot 2022-09-09 at 13 55 02
Screenshot 2022-09-09 at 13 55 15

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions