Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(view): add syncViewPadding support callback (#2995)
* feat(view): add syncViewPadding support callback * chore: rename new to instance
- Loading branch information
Showing
8 changed files
with
113 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { PaddingCalCtor } from '../layout/padding-cal'; | ||
import{ View } from '../view'; | ||
|
||
/** | ||
* 默认的 syncViewPadding 逻辑 | ||
* @param chart | ||
* @param views | ||
* @param PC: PaddingCalCtor | ||
*/ | ||
export function defaultSyncViewPadding(chart: View, views: View[], PC: PaddingCalCtor) { | ||
const syncPadding = PC.instance(); | ||
|
||
// 所有的 view 的 autoPadding 指向同一个引用 | ||
views.forEach((v: View) => { | ||
v.autoPadding = syncPadding.max(v.autoPadding.getPadding()); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters