BaCon canvas confusion [Solved]

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
PaulR
Posts: 249
Joined: Wed 04 May 2005, 18:45
Location: UK

BaCon canvas confusion [Solved]

#1 Post by PaulR »

Why does this code produce the result in the screenshot when I expect the canvas to have a 10 pixel 'margin'? I've tried various canvas/window sizes but the results are always similar and using DRAW canv doesn't seem to work. I've also varied the dpi setting in .Xresources just in case!

Code: Select all

INCLUDE "/usr/share/BaCon/hug.bac"
INIT

SUB testsub

	SQUARE ("#800000", 0, 0, 40, 40, 1)

END SUB

appWindow = WINDOW("Test", 320, 240)
canv=CANVAS(300, 220)
ATTACH(appWindow, canv, 10, 10)
CALLBACK(canv, testsub)
DISPLAY
Attachments
canvas.png
(1.66 KiB) Downloaded 146 times
Last edited by PaulR on Fri 12 Apr 2013, 07:29, edited 1 time in total.

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#2 Post by vovchik »

Dear Paul,

Add

Code: Select all

HUGOPTIONS("NOSCALING")
after INIT.
Attachments
noscaling.png
(3.85 KiB) Downloaded 130 times

PaulR
Posts: 249
Joined: Wed 04 May 2005, 18:45
Location: UK

#3 Post by PaulR »

Scaling! Grrrrrr!

:D

Thanks vovchick

Post Reply