mirror of https://github.com/axmolengine/axmol.git
Don't set scale and loadHTMLString on nil.
This commit is contained in:
parent
9bdf758d5a
commit
80576b5903
|
@ -164,6 +164,7 @@ static std::string getFixedBaseUrl(const std::string& baseUrl)
|
|||
}
|
||||
|
||||
- (void)loadHTMLString:(const std::string &)string baseURL:(const std::string &)baseURL {
|
||||
if (!self.uiWebView) {[self setupWebView];}
|
||||
[self.uiWebView loadHTMLString:@(string.c_str()) baseURL:[NSURL URLWithString:@(getFixedBaseUrl(baseURL).c_str())]];
|
||||
}
|
||||
|
||||
|
@ -211,6 +212,7 @@ static std::string getFixedBaseUrl(const std::string& baseUrl)
|
|||
}
|
||||
|
||||
- (void)setScalesPageToFit:(const bool)scalesPageToFit {
|
||||
if (!self.uiWebView) {[self setupWebView];}
|
||||
self.uiWebView.scalesPageToFit = scalesPageToFit;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue