I have a script for a "Stop After Current" button. I've used gr.DrawLine() to draw an "X" , with the color depending on whether SAC is active. The problem is it does not display correctly when foobar2000 is started. It only draws a small portion of the line drawn top-left to bottom-right, and none of the second line. But - if I bring up the WSH panel config and just click on [Apply] or [OK], then it displays fully as expected.
Here is just the the meat of the script; enough to demonstrate the issue:
var ww = window.Width;
var wh = window.Height;
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
function on_paint(gr) {
gr.DrawLine(3, 3, ww-4, wh-4, 2, fb.StopAfterCurrent ? RGB(128,128,128) : RGB(188,188,188));
gr.DrawLine(3, wh-4, ww-4, 3, 2, fb.StopAfterCurrent ? RGB(128,128,128) : RGB(188,188,188)); }
function on_mouse_lbtn_up() {
fb.RunMainMenuCommand("Playback/Stop After Current");
window.Repaint(); }
function on_playlist_stop_after_current_changed() {
window.Repaint(); }
I'm using the most recent WSH Panel Mod (v1.5.3.1) (Inside a Panel Stack Splitter in Columns UI. But I checked it in a Default UI config and the problem was still present). Much appreciation for any feedback on whether it's something I've done wrong (other than drawing an X with lines instead of just using text...), or what the problem is, and how it can be solved.