1
0
mirror of synced 2025-12-14 10:28:11 +08:00

patch(#152): fixes resize issue when using zoom

This commit is contained in:
Jamie Peabody
2021-10-02 14:19:15 +01:00
parent b49c9ce40f
commit b9bc901dd2
3 changed files with 7 additions and 1 deletions

View File

@@ -1,5 +1,8 @@
# Changes
## 4.3.3
* patch: Fixes resize issue when using zoom [#152](https://github.com/wickedest/Mergely/issues/152).
## 4.3.2
* patch: Reset the current change position when [setValue](https://mergely.com/doc##options_callbacks), [clear](https://mergely.com/doc#clear), [lhs](https://mergely.com/doc#lhs) or [rhs](https://mergely.com/doc#rhs) are called.

View File

@@ -1,6 +1,6 @@
{
"name": "mergely",
"version": "4.3.2",
"version": "4.3.3",
"description": "A javascript UI for diff/merge",
"directories": {
"doc": "doc",

View File

@@ -663,6 +663,8 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
}
},
resize: function() {
// recalculate line height as it may be zoomed
this.em_height = null;
this.settings.resize();
this._changing(this.id + '-lhs', this.id + '-rhs');
this._set_top_offset(this.id + '-lhs');
@@ -824,6 +826,7 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
var sz_timeout1 = null;
var sz = function(init) {
if (self.settings.resize) self.settings.resize(init);
self.resize();
self.editor[self.id + '-lhs'].refresh();
self.editor[self.id + '-rhs'].refresh();
};