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

CanvasItem draw implement antialiasing for circle, rect, multiline, and dashedline #84523

Merged

Conversation

xiongyaohua
Copy link
Contributor

@xiongyaohua xiongyaohua commented Nov 6, 2023

(This PR is an follow-up for #84497, kept as draft for now. see #84472 (comment))

func _draw():
	draw_circle(Vector2(100,100), 100, Color.BROWN, true)
	draw_circle(Vector2(100,400), 100, Color.BROWN, true, -1.0, true)
	
	draw_rect(Rect2(400, 0, 200, 200), Color.AQUA, true, -1.0)
	draw_rect(Rect2(400, 300, 200, 200), Color.AQUA, true, -1.0, true)
Screenshot 2023-11-06 at 21 12 14

@xiongyaohua xiongyaohua requested review from a team as code owners November 6, 2023 13:26
@AThousandShips AThousandShips added this to the 4.x milestone Nov 6, 2023
@xiongyaohua xiongyaohua changed the title Canvasitem draw antialiased circle and rect Canvasitem draw filled circle and rect with anti aliasing Nov 6, 2023
@xiongyaohua xiongyaohua force-pushed the canvasitem_antialiased_for_filled branch from 4961a1a to 7acdf21 Compare November 6, 2023 14:17
@AThousandShips AThousandShips changed the title Canvasitem draw filled circle and rect with anti aliasing Canvasitem draw filled circle and rect with antialiasing Nov 6, 2023
@xiongyaohua xiongyaohua marked this pull request as draft November 8, 2023 02:55
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally (rebased on top of master 6118592), it works as expected in all rendering methods.

Testing project: test-antialiased-filled-circle-rect.zip

output

Remember to add GDExtension compatibility methods as you did in #84472.

@xiongyaohua xiongyaohua force-pushed the canvasitem_antialiased_for_filled branch 2 times, most recently from 64d8c0e to cb134c7 Compare May 9, 2024 11:49
@xiongyaohua xiongyaohua marked this pull request as ready for review May 9, 2024 11:50
@xiongyaohua xiongyaohua force-pushed the canvasitem_antialiased_for_filled branch 3 times, most recently from 9ee05b9 to d59add1 Compare May 9, 2024 14:40
@xiongyaohua xiongyaohua requested review from a team as code owners May 9, 2024 14:40
@xiongyaohua
Copy link
Contributor Author

@Calinou Updated, should be ready for review.

@xiongyaohua xiongyaohua requested a review from Calinou May 9, 2024 14:40
@xiongyaohua xiongyaohua changed the title Canvasitem draw filled circle and rect with antialiasing Canvasitem draw implement antialiasing for circle, rect, multiline, and dashedline May 9, 2024
doc/classes/CanvasItem.xml Outdated Show resolved Hide resolved
@xiongyaohua xiongyaohua force-pushed the canvasitem_antialiased_for_filled branch 2 times, most recently from 38fa306 to bf6d32e Compare May 13, 2024 08:43
Copy link
Member

@AThousandShips AThousandShips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

scene/main/canvas_item.h Outdated Show resolved Hide resolved
servers/rendering_server.h Outdated Show resolved Hide resolved
servers/rendering/renderer_canvas_cull.cpp Outdated Show resolved Hide resolved
@akien-mga akien-mga modified the milestones: 4.x, 4.3 May 13, 2024
@akien-mga akien-mga changed the title Canvasitem draw implement antialiasing for circle, rect, multiline, and dashedline CanvasItem draw implement antialiasing for circle, rect, multiline, and dashedline May 13, 2024
@xiongyaohua xiongyaohua force-pushed the canvasitem_antialiased_for_filled branch 2 times, most recently from 0bbdb4a to 6475a11 Compare May 13, 2024 10:50
@AThousandShips

This comment was marked as resolved.

including
- rect, circle; both filled and unfilled.
- polyline, multiline
@xiongyaohua xiongyaohua force-pushed the canvasitem_antialiased_for_filled branch from 6475a11 to ed3d311 Compare May 13, 2024 11:03
@akien-mga akien-mga merged commit 45ee0fd into godotengine:master May 13, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants