Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

If a 'train station' is where a train stops, what's a 'workstation'?


devel / comp.lang.tcl / Can I shift the coordinates of a canvas?

SubjectAuthor
o Can I shift the coordinates of a canvas?clt.to.davebr

1
Can I shift the coordinates of a canvas?

<8361668194706@dlp>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10131&group=comp.lang.tcl#10131

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: clt.to.d...@dfgh.net
Newsgroups: comp.lang.tcl
Subject: Can I shift the coordinates of a canvas?
Date: Fri, 11 Nov 22 19:25:06 GMT
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <8361668194706@dlp>
Injection-Info: reader01.eternal-september.org; posting-host="a9161b15488aaa182e1326ecb2577c97";
logging-data="982836"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+nQSDJVYNZGF2y7vVd194b"
Cancel-Lock: sha1:m6pJLnSFXAk5cwTdI60Irb+LwJE=
 by: clt.to.d...@dfgh.net - Fri, 11 Nov 2022 19:25 UTC

>But I would love to be able to "shift" everything so that zero always refers
>to the middle vertical line (x) and the middle horizontal line (y) when
>writing code, I mean:

You can draw everything around the origin, them move all items by adding an x and y displacement
using the canvas move command.

>
>Instead of writing
>
>$::w.outer.canv create line 0 540 1920 540 -fill black
>
>I would write
>
>$::w.outer.canv create line -540 0 540 0 -fill black
>
>So the leftmost edge is now negative and the center is zero.
>
>I read the manual page and found a section that explains about COORDINATES
>and COORDINATES, but I don't really understand what it says. For example,
>
>"Canvases do not support scaling or rotation of the canvas coordinate system
>relative to the window coordinate system."

However they do support scrolling. See the -scrollregion configuration option and the canvas xview and yview commands. If you set -scrollregion size to match the window size, the whole scroll region will be displayed (xview and yview are not needed).

Dave B

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor