Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1824: expand function groups on hover #1907

Merged
merged 5 commits into from
Dec 12, 2022

Conversation

KonstantinEpam23
Copy link
Collaborator

No description provided.

@@ -229,13 +229,12 @@ Render.prototype.update = function (force = false, viewSz = null) {
const marg = this.options.autoScaleMargin
const mv = new Vec2(marg, marg)
const csz = viewSz
if (csz.x < 2 * marg + 1 || csz.y < 2 * marg + 1) {
if (marg && (csz.x < 2 * marg + 1 || csz.y < 2 * marg + 1)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Propose to name it autoScaleMargin

@@ -52,6 +52,12 @@ export class FunctionalGroup {
)
}

static getFunctionalGroupByName(searchName: string): Struct | null {
const provider = FunctionalGroupsProvider.getInstance()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future: I think, may be its worth to make methods static. It's unlikely that we will have multiple functional groups types.

static getFunctionalGroupByName(searchName: string): Struct | null {
const provider = FunctionalGroupsProvider.getInstance()
const types = provider.getFunctionalGroupsList()
return types.find((fnGroup) => fnGroup.name === searchName) || null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Propose to rename it to functionalGroups

if (!isAtomToolChosen) {
this.hoverIcon.hide()
// hide icon if not AtomToll chosen
if (name !== 'atom') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess, there was some mistake during merge. Previous solution was better :)

@@ -155,7 +156,10 @@ export default function initEditor(dispatch, getState) {
},
onSgroupEdit: (sgroup) =>
sleep(0) // huck to open dialog after dispatch sgroup tool action
.then(() => openDialog(dispatch, 'sgroup', fromSgroup(sgroup)))
.then(() => {
console.log('onSgroupEdit')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Propose to remove this console.log

}

// @ts-ignore
var groupStructPosition =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Propose to use const

Comment on lines 50 to 51
let rX = 0
let rY = 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is r mean in rX and rY?

? functionGroupInfoSelector(store).groupId
: null,
functionalGroups: allSGroupsSelector(store).map((template) => {
const struct = template.struct.clone()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for modifiedStruct anymore

)
}
export default connect((store) => ({
groupName: functionGroupInfoSelector(store)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be functionGroupInfoSelector(store)?.id || null and the same for others?

@KonstantinEpam23
Copy link
Collaborator Author

Merging for release candidate, a fix is coming shortly

@KonstantinEpam23 KonstantinEpam23 marked this pull request as ready for review December 12, 2022 17:48
@KonstantinEpam23 KonstantinEpam23 merged commit 4edb41e into master Dec 12, 2022
@KonstantinEpam23 KonstantinEpam23 deleted the #1824-hover-over-function-group branch December 12, 2022 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show underlying structure on mouse hover for functional groups and salts&solvents
3 participants