Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 10-23-2023, 11:58 AM   #1
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,706
Default gfx.circle adds offset when half of it is outside top/left of the window

I just noticed, that gfx.circle adds an offset of 1 pixel to its position, when half of it is outside of the window.
It adds an offset toward the bottom when it's halfway outside the top of the window and it adds an offset to the right, when halfway outside the left of the window.

The following gif shows the problem:


It deforms some of my graphical elements, that I try to draw and move around in the window.

Tested on Reaper 7.01 on Windows 7

Here's the code I used to test it.
A,B,C and D control the position of the circle:

Code:
y=0
x=0

function main()
  gfx.init()
  gfx.set(1,1,1)
  gfx.rect(x,y,100,100,1)
  gfx.set(1,0,0)
  gfx.circle(x+50,y+50,50,1)
  
  gfx.x=0
  gfx.y=110
  gfx.drawstr("x:"..x.." y:"..y)
  A=gfx.getchar()
  if A==65 then y=y-1 end
  if A==66 then y=y+1 end
  
  if A==67 then x=x-1 end
  if A==68 then x=x+1 end
  
  reaper.defer(main)
end

main()
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is online now   Reply With Quote
Old 10-23-2023, 12:06 PM   #2
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,706
Default

Same with gfx.arc.

In addition: gfx.arc shows in the doc-line at the top of the IDE that the fifth parameter is optional, but ReaScript complains if I omit it, demanding 5 parameters.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is online now   Reply With Quote
Old 10-23-2023, 02:12 PM   #3
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,998
Default

ahh rounding rounding
Justin is offline   Reply With Quote
Old 10-23-2023, 02:20 PM   #4
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,998
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Same with gfx.arc.

In addition: gfx.arc shows in the doc-line at the top of the IDE that the fifth parameter is optional, but ReaScript complains if I omit it, demanding 5 parameters.
it requires 5 parameters, the 6th (AA) is optional...
Justin is offline   Reply With Quote
Old 10-24-2023, 07:53 AM   #5
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,706
Default

Quote:
Originally Posted by Justin View Post
it requires 5 parameters, the 6th (AA) is optional...
Ah, yes...I misread it and skipped the r-parameter for some reason.
It was late XD
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:02 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.