mikke89 / RmlUi

RmlUi - The HTML/CSS User Interface library evolved
https://mikke89.github.io/RmlUiDoc/
MIT License
2.57k stars 295 forks source link

Rml::SystemInterface::JoinPath not used when using RmlDebugger causes different resource search paths on my debug and release builds #603

Closed germandiagogomez closed 3 months ago

germandiagogomez commented 3 months ago

Problem

I have a line like this in my code:

#if MY_APP_DEBUG
  Rml::Debugger::Initialise(i_->rmlContext_);
#endif

And my system interface does like this in JoinPath:

void MySystemInterface::JoinPath(Rml::String &translated_path, const Rml::String &document_path,
                const Rml::String &path) final {
    translated_path = path;
  }

When MY_APP_DEBUG is 1, Rml::Debugger is used. When used, MySystemInterface::JoinPath is not used or called.

This leads to the following:

In my file main_menu.rml I have something like this:

...href="overlays/rml.rcss" />

Expected result

href path should generate the same path in both release (when not using Rml::Debugger) and debug mode (when using Rml::Debugger).

Actual result

In release mode, the path generated to search in my FileSystemInterface is "overlays/rml.rcss" but when activating debug mode the result is "overlays/overlays/rml.rcss" (note the duplicated "overlays/overlays", yet the href in my rml file is still "overlays/rml.rcss".

mikke89 commented 3 months ago

Which version of the library are you using?

I believe this one is already resolved by #462.

germandiagogomez commented 3 months ago

@mikke89 I am using RmlUi 5.1.

mikke89 commented 3 months ago

I see, please use a commit that includes the above patch, as this one should already be resolved.