moleditpy 1.1.2__tar.gz → 1.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moleditpy
3
- Version: 1.1.2
3
+ Version: 1.1.3
4
4
  Summary: A cross-platform, simple, and intuitive molecular structure editor built in Python. It allows 2D molecular drawing and 3D structure visualization. It supports exporting structure files for input to DFT calculation software.
5
5
  Author-email: HiroYokoyama <titech.yoko.hiro@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/HiroYokoyama/python_molecular_editor
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  name = "moleditpy"
7
7
 
8
- version = "1.1.2"
8
+ version = "1.1.3"
9
9
 
10
10
  authors = [
11
11
  { name="HiroYokoyama", email="titech.yoko.hiro@gmail.com" },
@@ -11,7 +11,7 @@ DOI 10.5281/zenodo.17268532
11
11
  """
12
12
 
13
13
  #Version
14
- VERSION = "1.1.2"
14
+ VERSION = "1.1.3"
15
15
 
16
16
  import sys
17
17
  import numpy as np
@@ -450,11 +450,14 @@ class BondItem(QGraphicsItem):
450
450
  painter.drawPolygon(poly)
451
451
 
452
452
  elif self.stereo == 2: # Dash (破線)
453
+ pen = painter.pen()
454
+ pen.setWidthF(2.5) # デフォルトの太さ(2)から少し太くする
455
+ painter.setPen(pen)
453
456
  num_dashes = 8
454
457
  for i in range(num_dashes + 1):
455
458
  t = i / num_dashes
456
459
  start_pt = p1 * (1 - t) + p2 * t
457
- width = 5.0 * (1 - t)
460
+ width = 12.0 * (1 - t)
458
461
  offset = QPointF(normal.dx(), normal.dy()) * width / 2.0
459
462
  painter.drawLine(start_pt - offset, start_pt + offset)
460
463
 
@@ -476,39 +479,14 @@ class BondItem(QGraphicsItem):
476
479
  # --- 2. ホバー時のエフェクトを上から重ねて描画 ---
477
480
  if (not self.isSelected()) and getattr(self, 'hovered', False):
478
481
  try:
479
- hover_pen = QPen(QColor(144, 238, 144, 180), 8) # 少し太くして見やすく
482
+ # ホバー時のハイライトを太めの半透明な線で描画
483
+ hover_pen = QPen(QColor(144, 238, 144, 180), 8) # LightGreen, 半透明
480
484
  hover_pen.setCapStyle(Qt.PenCapStyle.RoundCap)
481
485
  painter.setPen(hover_pen)
482
- painter.drawLine(line) # 中心線をなぞる
486
+ painter.drawLine(line)
483
487
  except Exception:
484
488
  pass
485
489
 
486
- if self.order == 1:
487
- painter.drawLine(line)
488
- else:
489
- v = line.unitVector().normalVector()
490
- offset = QPointF(v.dx(), v.dy()) * BOND_OFFSET
491
- if self.order == 2:
492
- painter.drawLine(line.translated(offset))
493
- painter.drawLine(line.translated(-offset))
494
- elif self.order == 3:
495
- painter.drawLine(line)
496
- painter.drawLine(line.translated(offset))
497
- painter.drawLine(line.translated(-offset))
498
-
499
- # ホバー時は中央の線に太めの薄い緑を重ねて「枠っぽく」見せる
500
- if (not self.isSelected()) and getattr(self, 'hovered', False):
501
- try:
502
- line = self.get_line_in_local_coords()
503
- if line.length() > 0:
504
- hover_pen = QPen(QColor(144, 238, 144, 180), 6) # 太めで透過
505
- hover_pen.setCapStyle(Qt.PenCapStyle.RoundCap)
506
- hover_pen.setJoinStyle(Qt.PenJoinStyle.RoundJoin)
507
- painter.setPen(hover_pen)
508
- # 中心をなぞる一本線で十分視認できる(複数本線の結合も中心線で可)
509
- painter.drawLine(line)
510
- except Exception:
511
- pass
512
490
 
513
491
 
514
492
  def update_position(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moleditpy
3
- Version: 1.1.2
3
+ Version: 1.1.3
4
4
  Summary: A cross-platform, simple, and intuitive molecular structure editor built in Python. It allows 2D molecular drawing and 3D structure visualization. It supports exporting structure files for input to DFT calculation software.
5
5
  Author-email: HiroYokoyama <titech.yoko.hiro@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/HiroYokoyama/python_molecular_editor
File without changes
File without changes