Fix _adjustSize missing

This commit is contained in:
Paulo Gustavo Veiga 2022-02-11 23:38:20 -08:00
parent 645a40d3f7
commit 3df835081c
2 changed files with 7 additions and 12 deletions

View File

@ -179,7 +179,7 @@ class StandaloneActionDispatcher extends ActionDispatcher {
$assert(topicsIds, 'topicIds can not be null');
$assert(color, 'topicIds can not be null');
const commandFunc = (topic, commandColor) => {
const commandFunc = (topic: Topic, commandColor: string) => {
const result = topic.getBorderColor();
topic.setBorderColor(commandColor);
return result;
@ -212,9 +212,9 @@ class StandaloneActionDispatcher extends ActionDispatcher {
$assert(topicsIds, 'topicsIds can not be null');
$assert(shapeType, 'shapeType can not be null');
const commandFunc = (topic, commandShapeType) => {
const commandFunc = (topic: Topic, commandShapeType: string) => {
const result = topic.getShapeType();
topic.setShapeType(commandShapeType, true);
topic.setShapeType(commandShapeType);
return result;
};
@ -226,12 +226,12 @@ class StandaloneActionDispatcher extends ActionDispatcher {
changeFontWeightToTopic(topicsIds: number[]) {
$assert(topicsIds, 'topicsIds can not be null');
const commandFunc = (topic) => {
const commandFunc = (topic: Topic) => {
const result = topic.getFontWeight();
const weight = result === 'bold' ? 'normal' : 'bold';
topic.setFontWeight(weight, true);
topic._adjustShapes();
topic.adjustShapes();
return result;
};

View File

@ -104,15 +104,10 @@ abstract class Topic extends NodeGraph {
});
}
/**
* @param {String} type the topic shape type
* @see {@link mindplot.model.INodeModel}
*/
setShapeType(type) {
setShapeType(type: string): void {
this._setShapeType(type, true);
}
/** @return {mindplot.Topic} parent topic */
getParent(): Topic | null {
return this._parent;
}
@ -162,7 +157,7 @@ abstract class Topic extends NodeGraph {
}
/** @return {String} topic shape type */
getShapeType() {
getShapeType(): string {
const model = this.getModel();
let result = model.getShapeType();
if (!$defined(result)) {