Skip to content

(1) Fix/legend - #389

Merged
Tanguylo merged 7 commits into
devfrom
fix/legend
Jul 11, 2024
Merged

(1) Fix/legend#389
Tanguylo merged 7 commits into
devfrom
fix/legend

Conversation

@Tanguylo

Copy link
Copy Markdown
Collaborator

Fixing text writing in legend.
Fix is quite dirty

@Tanguylo
Tanguylo requested a review from GhislainJJune 17, 2024 15:54
@TanguyloTanguylo changed the title Fix/legend(1) Fix/legendJun 19, 2024
Comment threadsrc/shapes.ts Outdated
this.text.rowIndices = [];
try {
this.text.draw(context);
} catch (TypeError) {}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It seems weird to do nothing when catching an error. What is the usecase, here ?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

It is to avoid a bug when objects are too small and their dimensions cannot be handled anymore by canvas.
Catching this error allows to play from very wide pics to very small not drawn pics without crashing web browser

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Alright, I think stating it as a comment in the catch statement could help next devs to understand it

@Tanguylo
Tanguylo merged commit 293d749 into devJul 11, 2024
@Tanguylo
Tanguylo deleted the fix/legend branch July 11, 2024 12:47
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: donetype: bugSomething isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Tanguylo@GhislainJ