std::max should be replaced by ImMax