From c41d7a8611d68008015873d390570dcab27dcebe Mon Sep 17 00:00:00 2001 From: cedrick-f Date: Sat, 13 Jun 2015 09:34:07 +0200 Subject: [PATCH] Bugfix : erreur affichage petits cadres --- pySequence.iss | 6 +++--- src/draw_cairo.py | 2 +- src/draw_cairo_seq.py | 8 +++++--- src/version.py | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pySequence.iss b/pySequence.iss index 07a4836d..0a4d1b99 100644 --- a/pySequence.iss +++ b/pySequence.iss @@ -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 @@ -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" diff --git a/src/draw_cairo.py b/src/draw_cairo.py index 3ad2b99c..b560d9b5 100644 --- a/src/draw_cairo.py +++ b/src/draw_cairo.py @@ -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 diff --git a/src/draw_cairo_seq.py b/src/draw_cairo_seq.py index b6beb17a..caf5d0d8 100644 --- a/src/draw_cairo_seq.py +++ b/src/draw_cairo_seq.py @@ -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) @@ -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]) diff --git a/src/version.py b/src/version.py index 7dcd25cf..9aa158fe 100644 --- a/src/version.py +++ b/src/version.py @@ -44,7 +44,7 @@ __appname__= "pySequence" __author__ = u"Cédrick FAURY" -__version__ = "6.0-beta.18" +__version__ = "6.0-beta.19" print __version__