OpenXTalkPaul wrote: ↑Tue Apr 23, 2024 6:17 pm
I'm currently trying to catch up on rolling in some stuff from OXT Lite, really want to add that fix for pixel image drawings not saving. I thought that had been discussed/resolved previously.
I'll elaborate on that in a bit. It's mostly all in the revTools stack, although there is a slight modification to the brush popup stack too.
In the "revBrushpopup.livecode"
Code: Select all
on preOpenStack
set the systemwindow of this stack to true -- floats the window as didn't always on Linux
...
in revtools.livecodescript
I added these two functions:
Code: Select all
function hCreateSuitableImage tTool
-- bug found (tperry, richmond62, & micmac 22-4-24)
--put "the tool is: " & tTool -- debug (tperry 22-4-24)
put the short name of the topStack into tTheCurrentStackName
put the last word of the currentcard of stack tTheCurrentStackName into tCardID
put "suitable-paintimage" into tNewPaintName
if there is an image tNewPaintName of card id tCardID of stack tTheCurrentStackName then
set the tNewImgCmd of stack "revTools" to ""
return true
exit hCreateSuitableImage
end if
--
put the number of images of card id tCardID of stack tTheCurrentStackName into tImgCount
if tImgCount <1 then
-- no images on the card!
put "create image " & QUOTE & tNewPaintName & QUOTE & " in card id " & tCardID & " of stack " & QUOTE & tTheCurrentStackName & QUOTE into tSuitableImageSetup
set the tNewImgCmd of stack "revTools" to tSuitableImageSetup
return false
else
-- there are images on the card
return true
end if
end hCreateSuitableImage
on tDoImgCmd -- handler to actually create the paint image we are missing (tperry 22-4-24)
if tImgCmd is true then exit tDoImgCmd
if the tNewImgCmd of stack "revTools" is "" then exit tDoImgCmd
put the tNewImgCmd of stack "revTools" into tImgCmd
do tImgCmd
replace QUOTE with return in tImgCmd
delete line 1 of tImgCmd
put word 4 of line 2 of tImgCmd into line 2 of tImgCmd
-- the next 3 lines are a bit hacky, but otherwise it freezes the tools palette
put line 1 of tImgCmd into tImgName
put line 2 of tImgCmd into tImgID
put line 3 of tImgCmd into tImgStack
--
set the rect of image tImgName of card id tImgID of stack tImgStack to 0,0,the width of stack tImgStack, the height of stack tImgStack
set the layer of image tImgName of card id tImgID of stack tImgStack to bottom -- just to make sure it doesn't obscure any buttons (tperry 23-4-24)
end tDoImgCmd
Then, in the mousedown handler:
Code: Select all
case "paint tool"
local tTool
put the cToolName of the target into tTool
revToolsConfigurePaint
revIDESetTool tTool
put hCreateSuitableImage (tTool) into tImgCmd
send tDoImgCmd to me in 1 ticks
-- Set the tool cursor
-- The tool does not actually work without doing this
...
You could probably clean this up and refine it further, but I found this works without error and is quick in it's execution. I've only tested that on Linux so far, not MacOS or Windows yet, so might need some refinement.
OpenXTalkPaul wrote: ↑Tue Apr 23, 2024 6:17 pm
I'm not adding everything (for example the moveable/standard-window-revMenuBar is rather wonky on macOS so not add to DPE).
Understandable. I wasn't sure if I want to keep it in or not. Richmond did originally request it be draggable, but I don't know if he meant as a standard window (so you have both), but that can all be toggled. I set that as hidden as default on the later builds of OXT lite.

- toolbar.png (64.76 KiB) Viewed 2974 times