# Changing bond order does not adjust H count properly

**URL:** <https://discuss.avogadro.cc/t/changing-bond-order-does-not-adjust-h-count-properly/3944>\
**Category:** Support\
**Created:** [August 27, 2022, 1:03pm UTC](https://discuss.avogadro.cc/t/changing-bond-order-does-not-adjust-h-count-properly/3944 "2022-08-27T13:03:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![seal](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/seal/32/1234_2.png) [@seal](https://discuss.avogadro.cc/u/seal)\
**Post date:** [August 27, 2022, 1:03pm UTC](https://discuss.avogadro.cc/t/changing-bond-order-does-not-adjust-h-count-properly/3944/1 "2022-08-27T13:03:17Z")

</div>

I believe this to be a bug with Avogadro

## Environment Information

Avogadro version: 1.97.0 shader build  
Operating system and version: macOS 12.5.1

## Expected Behavior

Start with

 ![image](https://discuss.avogadro.cc/uploads/default/original/2X/d/d853f4e5cbe472a12207c9bb0a7d3453f7f12b3d.jpeg)

I want to change the C-C single bond (upper right) to a double bond. I try to do it two ways:

Click on a bond:

 ![image](https://discuss.avogadro.cc/uploads/default/original/2X/f/f3e8817ee647861caa06e02899ce0e55c498cb83.jpeg)

Or select  
 ![image](https://discuss.avogadro.cc/uploads/default/original/2X/1/1050c3339d60dbf8951d06a5fd8e0fd6d00c8ba5.png)

And clicking on one atom drag to another:

 ![image](https://discuss.avogadro.cc/uploads/default/original/2X/a/a41a6e3be655c424cc78f633fefc7524a1acdea4.jpeg)

That said, if I click on a bond and then clicking one and dragging to another, I do get the right thing:

 ![image](https://discuss.avogadro.cc/uploads/default/original/2X/0/094894e499b6372ee519494057f9acc41f1d04f8.jpeg)

---

<div class="post-metadata">

**Author:** ![seal](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/seal/32/1234_2.png) [@seal](https://discuss.avogadro.cc/u/seal)\
**Post date:** [August 27, 2022, 1:06pm UTC](https://discuss.avogadro.cc/t/changing-bond-order-does-not-adjust-h-count-properly/3944/2 "2022-08-27T13:06:26Z")

</div>

Actually, there’s another thing – I can’t optimize this structure:

 ![image](https://discuss.avogadro.cc/uploads/default/original/2X/2/2d89ac3edce9dd8d097cd9aaa22fe2c1214c1e0f.png)

For reference, the force field is set to “forcefields”. But this could be part of the update to force fields that you’ve mentioned elsewhere.

 ![image](https://discuss.avogadro.cc/uploads/default/original/2X/b/b09e88c88d8c444bfd1b99ec5003abe690aa0ec5.png)

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [August 27, 2022, 3:23pm UTC](https://discuss.avogadro.cc/t/changing-bond-order-does-not-adjust-h-count-properly/3944/3 "2022-08-27T15:23:34Z")

</div>

I don’t know which build you’re using - I’m pretty sure the hydrogen bug was fixed [recently](https://github.com/OpenChemistry/avogadrolibs/pull/1112). I’d suggest a nightly build:

[https://two.avogadro.cc/](https://two.avogadro.cc/)

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [August 27, 2022, 3:24pm UTC](https://discuss.avogadro.cc/t/changing-bond-order-does-not-adjust-h-count-properly/3944/4 "2022-08-27T15:24:22Z")

</div>

> [@seal](#):
>
> For reference, the force field is set to “forcefields”. But this could be part of the update to force fields that you’ve mentioned elsewhere.

No, that looks like there was a problem building Open Babel with that version.

---

<div class="post-metadata">

**Author:** ![seal](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/seal/32/1234_2.png) [@seal](https://discuss.avogadro.cc/u/seal)\
**Post date:** [August 27, 2022, 3:43pm UTC](https://discuss.avogadro.cc/t/changing-bond-order-does-not-adjust-h-count-properly/3944/5 "2022-08-27T15:43:08Z")

</div>

> [@ghutchis](#):
>
> I don’t know which build you’re using

I used this one from ~6 days ago

> <https://github.com/OpenChemistry/avogadrolibs/pull/1123>
>
> At the moment, it just applies SSAO and edge detection to spheres, cylinders and… opaque meshes, so as to test them. Some changes still pending:
> \* Extend it to other geometry types.
> \* Fix bugs, in particular SSAO working weird in perspective projection.
> \* Add dialog to configure rendering.
> 
> Developer Certificate of Origin
> Version 1.1
> 
> Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
> 1 Letterman Drive
> Suite D4700
> San Francisco, CA, 94129
> 
> Everyone is permitted to copy and distribute verbatim copies of this
> license document, but changing it is not allowed.
> 
> 
> Developer's Certificate of Origin 1.1
> 
> By making a contribution to this project, I certify that:
> 
> (a) The contribution was created in whole or in part by me and I
> have the right to submit it under the open source license
> indicated in the file; or
> 
> (b) The contribution is based upon previous work that, to the best
> of my knowledge, is covered under an appropriate open source
> license and I have the right under that license to submit that
> work with modifications, whether created in whole or in part
> by me, under the same open source license (unless I am
> permitted to submit under a different license), as indicated
> in the file; or
> 
> (c) The contribution was provided directly to me by some other
> person who certified (a), (b) or (c) and I have not modified
> it.
> 
> (d) I understand and agree that this project and the contribution
> are public and that a record of the contribution (including all
> personal information I submit with it, including my sign-off) is
> maintained indefinitely and may be redistributed consistent with
> this project or the open source license(s) involved.

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [August 27, 2022, 4:45pm UTC](https://discuss.avogadro.cc/t/changing-bond-order-does-not-adjust-h-count-properly/3944/6 "2022-08-27T16:45:54Z")

</div>

Right. I just don’t know if that has all the other fixes in it. The hydrogen bug was annoying - took ages to track down.
