barunsaha commited on
Commit
2aef36b
·
1 Parent(s): b655834

Disable icon shape's shadow and lower its position

Browse files
Files changed (1) hide show
  1. helpers/pptx_helper.py +4 -2
helpers/pptx_helper.py CHANGED
@@ -28,6 +28,7 @@ load_dotenv()
28
 
29
  # English Metric Unit (used by PowerPoint) to inches
30
  EMU_TO_INCH_SCALING_FACTOR = 1.0 / 914400
 
31
  INCHES_2 = pptx.util.Inches(2)
32
  INCHES_1_5 = pptx.util.Inches(1.5)
33
  INCHES_1 = pptx.util.Inches(1)
@@ -499,7 +500,7 @@ def _handle_icons_ideas(
499
  match = ICONS_REGEX.search(item)
500
 
501
  if not match:
502
- print('No icon/text pattern match found...skipping to the next item')
503
  continue
504
 
505
  icon_name = match.group(1)
@@ -507,7 +508,7 @@ def _handle_icons_ideas(
507
  icon_path = f'{GlobalConfig.ICONS_DIR}/{icon_name}.png'
508
 
509
  left = spacing + idx * (ICON_SIZE + spacing)
510
- top = pptx.util.Inches(2) # Adjust the vertical position as needed
511
 
512
  # Calculate the center position for alignment
513
  center = left + ICON_SIZE / 2
@@ -521,6 +522,7 @@ def _handle_icons_ideas(
521
  INCHES_1, INCHES_1
522
  )
523
  shape.fill.solid()
 
524
 
525
  # Set the icon's background shape color
526
  color = random.choice(ICON_COLORS)
 
28
 
29
  # English Metric Unit (used by PowerPoint) to inches
30
  EMU_TO_INCH_SCALING_FACTOR = 1.0 / 914400
31
+ INCHES_3 = pptx.util.Inches(3)
32
  INCHES_2 = pptx.util.Inches(2)
33
  INCHES_1_5 = pptx.util.Inches(1.5)
34
  INCHES_1 = pptx.util.Inches(1)
 
500
  match = ICONS_REGEX.search(item)
501
 
502
  if not match:
503
+ # print('No icon/text pattern match found...skipping to the next item')
504
  continue
505
 
506
  icon_name = match.group(1)
 
508
  icon_path = f'{GlobalConfig.ICONS_DIR}/{icon_name}.png'
509
 
510
  left = spacing + idx * (ICON_SIZE + spacing)
511
+ top = INCHES_3
512
 
513
  # Calculate the center position for alignment
514
  center = left + ICON_SIZE / 2
 
522
  INCHES_1, INCHES_1
523
  )
524
  shape.fill.solid()
525
+ shape.shadow.inherit = False
526
 
527
  # Set the icon's background shape color
528
  color = random.choice(ICON_COLORS)