Try to fix Events sheet wrong resizing of events on scroll#8551
Conversation
c7a652c to
91edf56
Compare
91edf56 to
22d7e36
Compare
| 'BuiltinCommonInstructions::Else': e => gd.asElseEvent(e), | ||
| }; | ||
|
|
||
| const getInstructionsListFromEvent = ( |
There was a problem hiding this comment.
A while event has getWhileConditions. What's the impact, is this a problem?
There was a problem hiding this comment.
very good remark. It looks like we're giving the same IDs for conditions and whileConditions, I'll look at fixing this
| const { _eventsTree: eventsTree } = this; | ||
| if (!eventsTree) return; | ||
|
|
||
| // Clear selection immediately alongside the history update so that stale |
| newEventsHistory.futureActions.length - 1 | ||
| ]; | ||
|
|
||
| // Always compute eventContexts — needed for both selection and scroll. |
| // which fires the version-gated useLayoutEffect below, calling recomputeRowHeights | ||
| // before the browser paints. Using requestAnimationFrame instead would defer the | ||
| // recompute to after the first paint, causing a visible frame of wrong-size slots. | ||
| const [, forceHeightRecompute] = (React.useReducer(x => x + 1, 0): [ |
There was a problem hiding this comment.
Use useForceUpdate which does the same
9356243 to
79922a9
Compare
| return isCondition ? 'conditions' : 'actions'; | ||
| }; | ||
|
|
||
| const getInstructionsListFromEvent = ( |
There was a problem hiding this comment.
Could have been a const gd::InstructionsList* GetInstructionList(const gd::String& label), re-implemented by each event.
Carefully though, C++ can't return null. If it returns a nullptr, then isNullPtr must be used to check what you got (it's not "null" in jS)
| const gd: libGDevelop = global.gd; | ||
|
|
||
| // Maps event types that have conditions+actions to their gd cast function. | ||
| const eventCasters: { [string]: ?(event: gdBaseEvent) => any } = { |
There was a problem hiding this comment.
These are a bit ugly in EventsSheet, see my other comment below
Fix #8510
before:
Enregistrement.de.l.ecran.2026-04-29.a.17.50.22.mov
After:
Enregistrement.de.l.ecran.2026-05-05.a.10.16.05.mov