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

Polygon::drawFrame() のバグを修正 #52

Open
wants to merge 2 commits into
base: v8_develop
Choose a base branch
from

Conversation

Raclamusi
Copy link
Member

@Raclamusi Raclamusi commented Nov 28, 2024

  • Polygon::drawFrame() で穴が描画されないバグを修正しました
  • Polygon::drawFrame() で使用される BuildClosedLineString()offset が各頂点の座標に2回足されることで offset の2倍を足した位置に描画されるバグを修正しました
    • BuildClosedLineString() 本体と SimplifyClosed() でそれぞれ offset が足されていたので、 BuildClosedLineString() 本体の方を削除しました
# include <Siv3D.hpp> // Siv3D v0.8.0

void Main()
{
	Scene::SetBackground(ColorF{ 0.6, 0.8, 0.7 });

	while (System::Update())
	{
		const double t = Scene::Time();

		Polygon polygon = Rect{ -100, -100, 200, 200 }.asPolygon();
		polygon.addHole(Triangle{ 100, (t * 3) });

		polygon.draw(200, 300);

		polygon.drawFrame(600, 300, 2);
	}
}

修正前(描画位置は調整しています)
20241128-132638-274

修正後
20241128-132510-740

@Raclamusi Raclamusi changed the base branch from main to v8_develop November 28, 2024 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant