Skip to content

Commit

Permalink
Bugfix : erreur affichage petits cadres
Browse files Browse the repository at this point in the history
  • Loading branch information
cedrick-f committed Jun 13, 2015
1 parent 9b3e59e commit c41d7a8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pySequence.iss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

;This file is part of pySequence
;
; Copyright (C) 2012 Cédrick FAURY
; Copyright (C) 2012-2015 Cédrick FAURY
;
;pySequence is free software; you can redistribute it and/or modify
;it under the terms of the GNU General Public License as published by
Expand All @@ -19,8 +19,8 @@

[ISPP]
#define AppName "pySequence"
#define AppVersion "6.0-beta.18"
#define AppVersionInfo "6.0.0.18"
#define AppVersion "6.0-beta.19"
#define AppVersionInfo "6.0.0.19"
#define AppVersionBase "6"

#define AppURL "https://github.com/cedrick-f/pySequence"
Expand Down
2 changes: 1 addition & 1 deletion src/draw_cairo.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def calc_h_texte(ctx, texte, w, taille, va = 'c', ha = 'c', b = 0.1, orient = 'h
width = ctx.text_extents(t)[2]
if width > w:
if j - i == 1:
lt[i:j] = textwrap.wrap(lt[i], int(1.0*len(lt)*w/width))
lt[i:j] = textwrap.wrap(lt[i], max(1,int(1.0*len(lt)*w/width)))
else:
ll.append(" ".join(lt[i:j-1]))
i = j-1
Expand Down
8 changes: 5 additions & 3 deletions src/draw_cairo_seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ def DefinirZones(seq, ctx):

intituleSeances[0], lstInt = seq.GetIntituleSeances()
for intS in lstInt:
# print " ", intS
h, t = calc_h_texte(ctx, intS, tailleZIntSeances[0], fontIntSeances)
intituleSeances[2].append(h)
intituleSeances[1].append(t)
Expand Down Expand Up @@ -1019,11 +1018,14 @@ def Draw(self, x, y):
self.ctx.select_font_face (font_family, cairo.FONT_SLANT_ITALIC,
cairo.FONT_WEIGHT_NORMAL)
self.ctx.set_source_rgba (0,0,0, alpha)
# print (x, y + hc, self.w, self.h-hc)
# print (wc, y, self.w - (wc-x), self.h)
# print
if self.h < 0.02: # h petit -> on écrit à coté du code !
rct = (wc, y, self.w - wc-x, self.h)
rct = (wc, y, self.w - (wc-x), self.h)
else:
rct = (x, y + hc, self.w, self.h-hc)

show_text_rect(self.ctx, self.seance.intitule, rct,
ha = 'g', b = 0.2, fontsizeMinMax = (minFont, 0.015),
fontsizePref = self.seance.taille.v[0])
Expand Down
2 changes: 1 addition & 1 deletion src/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

__appname__= "pySequence"
__author__ = u"Cédrick FAURY"
__version__ = "6.0-beta.18"
__version__ = "6.0-beta.19"
print __version__


Expand Down

0 comments on commit c41d7a8

Please sign in to comment.