Showing
2 changed files
with
14 additions
and
12 deletions
| ... | ... | @@ -349,17 +349,17 @@ |
| 349 | 349 | } |
| 350 | 350 | }; |
| 351 | 351 | </script> |
| 352 | - <link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/plgmlhohecdddhbmmkncjdmlhcmaachm"> | |
| 353 | - <link rel="apple-touch-icon" sizes="180x180" href="images/apple-touch-icon.png"> | |
| 352 | + <!-- <link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/plgmlhohecdddhbmmkncjdmlhcmaachm"> --> | |
| 353 | + <!-- <link rel="apple-touch-icon" sizes="180x180" href="images/apple-touch-icon.png"> --> | |
| 354 | 354 | <!-- <link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png">--> |
| 355 | 355 | <link rel="icon" type="image/png" sizes="32x32" href="images/logo-32x32.png"> |
| 356 | - <link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png"> | |
| 356 | + <!-- <link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png"> --> | |
| 357 | 357 | <!-- <link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png">--> |
| 358 | 358 | <link rel="mask-icon" href="images/safari-pinned-tab.svg" color="#d89000"> |
| 359 | 359 | <link rel="stylesheet" type="text/css" href="styles/grapheditor.css"> |
| 360 | - <link rel="preconnect" href="https://storage.googleapis.com"> | |
| 360 | + <!-- <link rel="preconnect" href="https://storage.googleapis.com"> | |
| 361 | 361 | <link rel="canonical" href="https://app.diagrams.net"> |
| 362 | - <link rel="manifest" href="images/manifest.json"> | |
| 362 | + <link rel="manifest" href="images/manifest.json"> --> | |
| 363 | 363 | <!-- <link rel="shortcut icon" href="favicon.ico">--> |
| 364 | 364 | <link rel="shortcut icon" href="images/logo-16x16.ico"> |
| 365 | 365 | <style type="text/css"> | ... | ... |
| ... | ... | @@ -3386,24 +3386,26 @@ EditorUi.prototype.lightboxFit = function(maxHeight) |
| 3386 | 3386 | } |
| 3387 | 3387 | |
| 3388 | 3388 | // LATER: Use initial graph bounds to avoid rounding errors |
| 3389 | - this.editor.graph.maxFitScale = this.lightboxMaxFitScale; | |
| 3390 | - this.editor.graph.fit(border, null, null, null, null, null, maxHeight); | |
| 3389 | + // this.editor.graph.maxFitScale = this.lightboxMaxFitScale; | |
| 3390 | + // this.editor.graph.fit(border, null, null, null, null, null, maxHeight); | |
| 3391 | 3391 | // this.editor.graph.maxFitScale = null; |
| 3392 | - // TODO thingsKit lightbox 默认缩放为1 | |
| 3392 | + // // TODO thingsKit lightbox 默认缩放为1 | |
| 3393 | 3393 | // console.log(this.editor.graph.view) |
| 3394 | 3394 | // this.editor.graph.view.setScale(1); |
| 3395 | 3395 | /// TODO thingsKit 设置内容最大化 |
| 3396 | 3396 | var margin = 2; |
| 3397 | 3397 | var max = 3; |
| 3398 | 3398 | var graph = this.editor.graph |
| 3399 | - | |
| 3399 | + var pageFormat = graph.pageFormat | |
| 3400 | 3400 | var bounds = graph.getGraphBounds(); |
| 3401 | 3401 | var cw = graph.container.clientWidth - margin; |
| 3402 | 3402 | var ch = graph.container.clientHeight - margin; |
| 3403 | - var w = bounds.width / graph.view.scale; | |
| 3404 | - var h = bounds.height / graph.view.scale; | |
| 3403 | + var w = pageFormat.width | |
| 3404 | + // var w = pageFormat.width / graph.view.scale; | |
| 3405 | + var h = pageFormat.height; | |
| 3406 | + // var h = pageFormat.height / graph.view.scale; | |
| 3405 | 3407 | var s = Math.min(max, Math.min(cw / w, ch / h)); |
| 3406 | - | |
| 3408 | + console.log({w, h, scale: graph.view.scale, cw, ch, s}) | |
| 3407 | 3409 | graph.view.scaleAndTranslate(s, |
| 3408 | 3410 | (margin + cw - w * s) / (2 * s) - bounds.x / graph.view.scale, |
| 3409 | 3411 | (margin + ch - h * s) / (2 * s) - bounds.y / graph.view.scale); | ... | ... |