Skip to content

Commit

Permalink
Make methods private, remove log, update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmartel committed Nov 22, 2024
1 parent 288c929 commit 9cd02fc
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/gui/drawLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ export class DrawLayer {
drawController.getAnnotationGroup().isEditable()) {
// shape groups at the current position
const shapeGroups =
this.getCurrentPosGroup().getChildren();
this.#getCurrentPosGroup().getChildren();
// listen if we have shapes
if (shapeGroups.length !== 0) {
this.#konvaStage.listening(true);
Expand Down Expand Up @@ -883,7 +883,7 @@ export class DrawLayer {
*/
isAnnotationVisible(id) {
// get the group (annotation and group have same id)
const group = this.getGroup(id);
const group = this.#getGroup(id);
if (typeof group === 'undefined') {
return false;
}
Expand All @@ -901,7 +901,7 @@ export class DrawLayer {
*/
setAnnotationVisibility(id, visible) {
// get the group (annotation and group have same id)
const group = this.getGroup(id);
const group = this.#getGroup(id);
if (typeof group === 'undefined') {
return false;
}
Expand Down Expand Up @@ -1110,9 +1110,9 @@ export class DrawLayer {
/**
* Get the current position group.
*
* @returns {Konva.Group|undefined} The Konva.Group.
* @returns {Konva.Group|undefined} The Konva group.
*/
getCurrentPosGroup() {
#getCurrentPosGroup() {
if (typeof this.#currentPosGroupId === 'undefined') {
return;
}
Expand Down Expand Up @@ -1145,14 +1145,10 @@ export class DrawLayer {
* Get a Konva group using its id.
*
* @param {string} id The group id.
* @returns {object|undefined} The Konva group.
* @returns {Konva.Group|undefined} The Konva group.
*/
getGroup(id) {
const group = this.getKonvaLayer().findOne('#' + id);
if (typeof group === 'undefined') {
logger.warn('Cannot find node with id: ' + id);
}
return group;
#getGroup(id) {
return this.getKonvaLayer().findOne('#' + id);
}

/**
Expand Down

0 comments on commit 9cd02fc

Please sign in to comment.