processing / processing/processing4
noStroke makes PShape.setTexture crash (P2D)
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 494
- フォーク
- 183
- 平均マージ
- 4時間 39分
- マージ済み PR(30日)
- 3
説明
Created by: TidensBarn
I had inexplicable crashes when using textures on PShapes that almost made me loose my will to live until I finally found the cause:
If I create a PShape in "noStroke" state, setTexture will work the first time, but when I then try to set a different texture and redraw, it'll crash:
PShape shape;
void settings() {
size(400, 400, P2D);
}
void setup() {
}
void draw() {
noStroke(); // Remove this, no crash
shape = createShape(RECT, 0, 0, 200, 200);
PImage p1 = loadImage("img1.png");
shape.setTexture(p1);
shape(shape);
PImage p2 = loadImage("img2.png"); // p2 needs to be a different size from p1
shape.setTexture(p2);
shape(shape); // Crash!
}
It's an ArrayIndexOutofBoundsException in PShapeOpenGL, line 843, because the field "firstLineVertex" happens to be -1...
Here's a sketch with images: crash.zip
Tested on Win 10, Processing 4.2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
提供されたクラッシュスケッチから始め、firstLineVertex が -1 と報告されている 843 行目付近の PShapeOpenGL を調査してください。noStroke() を使って P2D でこの失敗を再現し、その後、シェイプのテクスチャを異なるサイズの画像に置き換えて再描画してください。この一連の処理でクラッシュしなくなれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- computer-graphics
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100