Open Brun0oO opened 7 years ago
I did a mistake with "set cy [ expr { int($line_height) + 1 } ]", so... I replaced only "incr cy $line_height" (the thrown exception in the traceback) with "set cy [ expr { $cy + int($line_height) } ]" (my correction). I can launch the png export but the exported png (21300 px x 4100 px) is bad : the stiching is erroneus.... Any idea ?
A short-term recommendation would be to take a print screen of the diagrams... xD Windows has a Snipping tool, which may help in that regard.
In terms of actually fixing the problem, isn't it weird to be getting a decimal number, not an integer? It looks like that's referring to a height co-ordinate, so it may be worth going through the callback to find out where that number came from and why it isn't an integer.
Well, it seems that actually my correction is enough. I exported again the diagram and the result was good (!?) (I don't understand why my previous attempt was wrong..). Thanks Serenacula ! As I said, my tcl knowledges are very very low, I don't know how to trace the callback, so i'm going to use my "fix" as it is... But this project is very useful ! I love it !
@stepan-mitkin I'm having the same problem, even in the most recent version of DRAKON. By "most recent version," I mean that I downloaded the source repository via:
git clone https://github.com/stepan-mitkin/drakon_editor.git
I get this backtrace when I try to export to PNG:
objc[13378]: Class FIFinderSyncExtensionHost is implemented in both /System/Library/PrivateFrameworks/FinderKit.framework/Versions/A/FinderKit (0x7fff9e11fa70) and /System/Library/PrivateFrameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride (0x10ca99cd8). One of the two will be used. Which one is undefined.
tclsh8.6(13378,0x7fffa14cd340) malloc: *** error for object 0x10f80b000: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
[1] 13378 abort ./drakon_editor.tcl
And I get this backtrace when I try to export to PDF:
objc[13433]: Invalid or prematurely-freed autorelease pool 0x7ff196802050.
[1] 13433 abort ./drakon_editor.tcl
@Brun0oO Would you mind sharing a patch which has your changes that made DRAKON work properly again? Maybe @stepan-mitkin can merge your changes into the master branch and this issue will be fixed for everyone.
I think I saw the same error, but in Russian.
I tried zooming out and the export worked (but it was too small to read...)
For me it was fixed by changing these lines: https://github.com/stepan-mitkin/drakon_editor/blob/master/scripts/highlight.tcl#L374 https://github.com/stepan-mitkin/drakon_editor/blob/master/scripts/highlight.tcl#L410
replacing this:
incr cy [expr int($line_height)]
with this:
set cy [expr {$cy + int($line_height)}]
because cy is not necessarily an integer so you can't use incr
on it:
If $i is a non-integral real number, [incr] could not be used, but [set] could:
set i [expr {$i + 1}]
docs
Hi,
I got a large diagram and I want to save it as a png file. I got an error "Expected integer but go "3405.333333333333", here the traceback :
I got the same error, if i try to use the "export to pdf" command. If I use the command "View/See all", I don't have this error...
I've tried to replace all "incr cx $var" in "scripts/highlight.tcl" file by "set cx [ expr { int($var) + 1 } ]"(same correction for "incr cy $var" code) but without success :o( I got a bad png where texts are badly located). My tcl knowledges are very limited. Can anyone help me ? Thanks. Brun0oO