Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fn gg.Context.draw_rounded_rect_empty does not round the corners appropriately. #19470

Closed
islonely opened this issue Sep 29, 2023 · 0 comments
Closed
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@islonely
Copy link
Contributor

islonely commented Sep 29, 2023

Describe the bug

This is the 100x20 rectangle with a radius of 5 pixels generated by the draw_rounded_rect_empty function.
rounded_rect_gg

This is the same size rectangle generated in CSS.
rounded_rect_css

The draw_rounded_rect_filled function does not have the same problem.
rounded_rect_filled_gg

Reproduction Steps

import gg
import gx

[heap]
struct App {
	gg.Context
}

fn main() {
	mut app := &App{}
	app.Context = gg.new_context(
		width: 400
		height: 400
		user_data: app
		bg_color: gx.white
		frame_fn: frame
	)
	app.Context.run()
}

fn frame(mut app App) {
	app.begin()
	app.draw_rounded_rect_empty(app.width / 2 - 50, app.height / 2 - 10, 100, 20, 5, gx.black)
	app.end()
}

Expected Behavior

Expected the radius of each corner of the rectangle to be 5 pixels.

Current Behavior

Radius is a different size on every corner.

Possible Solution

No response

Additional Information/Context

No response

V version

V full version: V 0.4.1 68cbf27.b5f71df

Environment details (OS name and version, etc.)

V full version: V 0.4.1 68cbf27.b5f71df
OS: windows, Microsoft Windows 11 Pro v22621 64-bit
Processor: 16 cpus, 64bit, little endian,

getwd: C:\Windows\System32
vexe: C:\Users\imado\v\v.exe
vexe mtime: 2023-09-28 21:03:00

vroot: OK, value: C:\Users\imado\v
VMODULES: OK, value: C:\Users\imado\.vmodules
VTMP: OK, value: C:\Users\imado\AppData\Local\Temp\v_0

Git version: git version 2.33.1.windows.1
Git vroot status: weekly.2023.39-14-gb5f71dff (5 commit(s) behind V master)
.git/config present: true

CC version: Error: 'cc' is not recognized as an internal or external command,
operable program or batch file.

thirdparty/tcc status: thirdparty-windows-amd64 e90c2620

Note

You can vote for this issue using the 👍 reaction. More votes increase the issue's priority for developers.

Take into account that only the 👍 reaction counts as a vote.
Only reactions to the issue itself will be counted as votes, not comments.

@islonely islonely added the Bug This tag is applied to issues which reports bugs. label Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

1 participant