CodingTrain / CodingTrain/Suggestion-Box

windowResized() + line(pmouseX, pmouseY, mouseX, mouseY) problem

オープン
#504 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
言語のデータがありません
スター
570
フォーク
85
PR マージ指標
30日以内にマージされた PR はありません

説明

Hi There
Following this video along I bumped into a problem with no obvious solution:
https://www.youtube.com/watch?v=OIfEHD3KqCg&index=17&list=PLRqwX-V7Uu6bI1SlcCRfLH79HZrFAtBvX
Its a Q&A video that generated another Q!
If you resize the window the drawing made with line() disappears.
edit: testing again I realized that any drawing made like that would disappear with windowResized(). This is bad!
Here is the mini example:

```
function setup() {
canv = createCanvas(windowWidth, windowHeight);
canv.position(0, 0);
stroke(255, 0, 0);
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}
function draw() {
if (mouseIsPressed) {
line(pmouseX, pmouseY, mouseX, mouseY);
}
}
```

I may open an issue in the p5 Github about it. But still, maybe I'm missing something. In the forum no one knew the solution to that.

best regards,
Gil

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

この issue には、setup()、windowResized()、resizeCanvas()、draw() を使用する最小限の p5.js スケッチが提示されています。まず実行し、canvas のサイズを変更して描画が消える現象を再現してください。報告にはリポジトリのファイルやテストが記載されていないため、これがこの提案リポジトリではなく p5.js に属するものかどうかを判断してください。適切なプロジェクトを特定し、確認済みの解決策または振り分けの判断を記録できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
frontend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。