Recent Changes

Thursday, November 10

  1. page Drawing rule not initialized in segment edited Drawing rule not initialized in segment Description When graphics are redrawn from a stored se…

    Drawing rule not initialized in segment
    Description
    When graphics are redrawn from a stored segment, the drawing rule may be different from what it was when they were originally drawn.
    Example code to demonstrate the bug.
    Run this program and either minimize/maximize the window or cover it with another window and uncover it again. The circle should remain white but changes to blue when redrawn from the flushed segment:
    nomainwin
    open "Rule bug" for graphics_nsb as #w
    #w "trapclose [quit]"
    #w "fill blue; down; home"
    #w "circlefilled 100 100"
    #w "flush"
    #w "rule xor"
    wait
    [quit]
    close #w
    end
    Example code to work around the bug.
    Add an explicit rule over which will be stored in the segment. This has no effect on the graphics when originally drawn but causes them to be redrawn correctly, even if the rule has subsequently been changed:
    nomainwin
    open "Rule bug" for graphics_nsb as #w
    #w "trapclose [quit]"
    #w "fill blue; down; home; rule over"
    #w "circlefilled 100 100"
    #w "flush"
    #w "rule xor"
    wait
    [quit]
    close #w
    end

    (view changes)
    1:52 am

Thursday, October 13

  1. msg Ctrl-R breaks LB environment message posted Ctrl-R breaks LB environment You start menu item Edit | Restore (Ctrl-R) Now what does it supposed to do?
    Ctrl-R breaks LB environment
    You start menu item Edit | Restore (Ctrl-R)
    Now what does it supposed to do?
    6:51 am

Saturday, October 8

  1. page Scrollbar 'min' parameter cannot be used edited Scrollbar 'min' parameter cannot be used Description The HORIZSCROLLBAR and VERTSCROLLBAR comm…

    Scrollbar 'min' parameter cannot be used
    Description
    The HORIZSCROLLBAR and VERTSCROLLBAR commands, for use in a Graphics Window or a GRAPHICBOX, take optional parameters controlling the minimum and maximum values of the scroll range. However if the min parameter is specified as any non-zero value the graphics do not scroll correctly.
    Example code to demonstrate the bug.
    nomainwin
    WindowWidth = 400
    WindowHeight = 600
    graphicbox #demo.gb, 20, 20, 350, 500
    open "Graphics Glitch Demo" for window as #demo
    #demo "trapclose [quit]"
    #demo.gb "vertscrollbar on 100 1500" ' note non-zero min value
    #demo.gb "horizscrollbar on 100 2250" ' note non-zero min value
    #demo.gb "down; color black; backcolor white"
    #demo.gb "place 100 100; boxfilled 2600 2000"
    for x = 120 to 2520 step 100
    #demo.gb "place ";x;" 120"
    #demo.gb "\";x
    #demo.gb "place ";x + 15;" 150"
    #demo.gb "circle 25"
    next x
    for y = 120 to 1920 step 100
    #demo.gb "place 120 ";y
    #demo.gb "\";y
    #demo.gb "place 135 ";y + 30
    #demo.gb "circle 25"
    next y
    #demo.gb "flush"
    wait
    [quit]
    close #demo
    end
    Example code to work around the bug.
    There is no known workaround which allows the min parameter to be used, so the only solution is to set that parameter to zero and offset all the graphics coordinates to compensate (here 100 has been subtracted from all the coordinates):
    nomainwin
    WindowWidth = 400
    WindowHeight = 600
    graphicbox #demo.gb, 20, 20, 350, 500
    open "Graphics Glitch Demo" for window as #demo
    #demo "trapclose [quit]"
    #demo.gb "vertscrollbar on 0 1400" ' note zero min value
    #demo.gb "horizscrollbar on 0 2150" ' note zero min value
    #demo.gb "down; color black; backcolor white"
    #demo.gb "place 0 0; boxfilled 2500 1900"
    for x = 20 to 2420 step 100
    #demo.gb "place ";x;" 20"
    #demo.gb "\";x
    #demo.gb "place ";x + 15;" 50"
    #demo.gb "circle 25"
    next x
    for y = 20 to 1820 step 100
    #demo.gb "place 20 ";y
    #demo.gb "\";y
    #demo.gb "place 35 ";y + 30
    #demo.gb "circle 25"
    next y
    #demo.gb "flush"
    wait
    [quit]
    close #demo
    end

    (view changes)
    3:16 am

More