1. Hey guyz. Welcome to the All New Phlatforum!



    Sign Up and take a look around. There are so many awesome new features.

    The Phlatforum is a place we can all hang out and

    have fun sharing our RC adventures!

  2. Dismiss Notice

Center Line Fold Not Working on Mac

Discussion in 'SketchUcam Bugs' started by rschenk, Mar 15, 2010.

  1. rschenk

    rschenk New Member

    Offline
    Messages:
    1
    Trophy Points:
    0
    I'm running PhlatScript 0.923, Sketchup 7.1.6859 on a Snow Leopard Mac.

    Neither the Center Line nor the Fold tool are working. It highlights the edges, but nothing happens when I click.

    I looked at the CenterLineTool class and found the problem. It's on Line 50 of the CenterLineTool class, in the mouse handlers:
    [pre] def onLButtonDown(flags, x, y, view)
    added = false
    if (((flags & 1) == 1) && (@ph.do_pick(x, y) > 0))
    ...
    end
    view.model.selection.clear if !added
    end

    The culprit is the check on the flags bitmask:
    [pre](flags & 1) == 1[/pre]

    This mask never AND's with 1, ever.

    If I remove this conditional, the CenterLineTool works.

    I cannot find any information on SketchUp's API documentation about the meaning of the bits in this mask, but what I could find is Ruby constants for modifier keys, ie ALT_MODIFIER_MASK.

    I don't know what flags & 1 is trying to accomplish, but my guess to what's happening here is – for whatever unholy reason – the flag bitmasks are different on Mac vs Windows. I suspect that's why the Sketchup docs never explicitly define the bitmasks, but do provide constants.

    Like I said, I don't know what flags & 1 does, but I suspect this bug could be fixed by replacing it with the appropriate constant for the modifier this code is testing for. Example:
    if (flags & ALT_MODIFIER_MASK) && (@ph.do_pick(x, y) > 0)[/pre]
     
  2. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    rschenk, looks like a discussion has started up on this problem, just in case you want to get in on it:
    viewtopic.php?p=19285
     
  3. lyly10388

    lyly10388 New Member

    Offline
    Messages:
    1
    Trophy Points:
    0
    Thanks you for sharing
     

Share This Page