acts.SetVisible to 1 instead of true/false in commonaces.js

  • Problem Description

    The SetVisible action in the appearance ACES sets the visible property to 1 instead of true (or 0 instead of false) .

    this.visible = v;

    Subsequent check on visibility will fail because the value should be true/false

    This is the correct code (this.visible = (v !== 0);) in line 694 in

    c:\Program Files\Construct 2\exporters\html5\commonaces.js

    acts.SetVisible = function (v)

    {

    if (!v !== !this.visible)

    {

    this.visible = (v !== 0);

    this.runtime.redraw = true;

    }

    };

    Steps to Reproduce Bug

    • Add a video initially invisible
    • Add a button and attach the Set video to visible
    • Notice the visible property of the ACES has changed from false to 1

    Observed Result

    Visible property is set to 0 or 1

    Expected Result

    Visible property should be set to true or false

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Windows 10

    Construct 2 Version ID

    v2.212.2

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I don't think this actually has any functional effect on anything because 0 is falsey and 1 is truthy, but I guess it could help the JIT to keep the type, so fixed this for the next build.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)